Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: serverless/serverless-google-cloudfunctions
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.1.0
Choose a base ref
...
head repository: serverless/serverless-google-cloudfunctions
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.2.0
Choose a head ref
  • 3 commits
  • 12 files changed
  • 2 contributors

Commits on Jun 14, 2021

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    446d161 View commit details

Commits on Jul 23, 2021

  1. ci: Switch to Github Actions

    pgrzesik committed Jul 23, 2021
    Copy the full SHA
    9a137ab View commit details
  2. feat: Release 4.2.0

    pgrzesik committed Jul 23, 2021
    Copy the full SHA
    4a1aed7 View commit details
184 changes: 184 additions & 0 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
# master only

name: Integrate

on:
push:
branches: [master]

env:
SLS_IGNORE_WARNING: '*'
FORCE_COLOR: 1

jobs:
linuxNode14:
name: '[Linux] Node.js 14: Unit tests '
runs-on: ubuntu-latest
steps:
- name: Resolve last validated commit hash (for `git diff` purposes)
env:
# See https://github.com/serverlessinc/setup-cicd-resources
GET_LAST_VALIDATED_COMMIT_HASH_URL: ${{ secrets.GET_LAST_VALIDATED_COMMIT_HASH_URL }}
PUT_LAST_VALIDATED_COMMIT_HASH_URL: ${{ secrets.PUT_LAST_VALIDATED_COMMIT_HASH_URL }}
run: |
curl -f "$GET_LAST_VALIDATED_COMMIT_HASH_URL" -o /home/runner/last-validated-commit-hash || :
curl -X PUT -H "User-Agent:" -H "Accept:" -H "Content-Type:" -d "$GITHUB_SHA" "$PUT_LAST_VALIDATED_COMMIT_HASH_URL"
- name: Store last validated commit hash (as it's to be used in other job)
uses: actions/upload-artifact@v2
with:
name: last-validated-commit-hash
path: /home/runner/last-validated-commit-hash

- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 14.x
registry-url: https://registry.npmjs.org

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v2
with:
path: |
~/.npm
node_modules
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: npm-v14-${{ runner.os }}-${{ github.ref }}-

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm update --no-save
npm update --save-dev --no-save
- name: Unit tests
run: npm test

linuxNode16:
name: '[Linux] Node.js 16: Unit tests'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v2
with:
path: |
~/.npm
node_modules
key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: npm-v16-${{ runner.os }}-${{ github.ref }}-

- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm update --no-save
npm update --save-dev --no-save
- name: Unit tests
run: npm test

linuxNode12:
name: '[Linux] Node.js 12: Unit tests'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v2
with:
path: |
~/.npm
node_modules
key: npm-v12-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: npm-v12-${{ runner.os }}-${{ github.ref }}-

- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm update --no-save
npm update --save-dev --no-save
- name: Unit tests
run: npm test

linuxNode10:
name: '[Linux] Node.js v10: Unit tests'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Retrieve dependencies from cache
id: cacheNpm
uses: actions/cache@v2
with:
path: |
~/.npm
node_modules
key: npm-v10-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
restore-keys: |
npm-v10-${{ runner.os }}-${{ github.ref }}-
npm-v10-${{ runner.os }}-refs/heads/master-
- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 10.x

- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm update --no-save
npm update --save-dev --no-save
- name: Unit tests
run: npm test

tagIfNewVersion:
name: ubuntu-latest
runs-on: ubuntu-latest
needs: [linuxNode14, linuxNode16, linuxNode12, linuxNode10]
timeout-minutes: 30 # Default is 360
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# Ensure to have complete history of commits pushed with given push operation
# It's loose and imperfect assumption that no more than 30 commits will be pushed at once
fetch-depth: 30
# Tag needs to be pushed with real user token, otherwise pushed tag won't trigger the actions workflow
# Hence we're passing 'serverless-ci' user authentication token
token: ${{ secrets.USER_GITHUB_TOKEN }}

- name: Resolve last validated commit hash (for `git diff` purposes)
uses: actions/download-artifact@v2
continue-on-error: true
with:
name: last-validated-commit-hash
path: /home/runner
- name: Tag if new version
run: |
LAST_VALIDATED_COMMIT_HASH=`cat /home/runner/last-validated-commit-hash` || :
if [ -n "$LAST_VALIDATED_COMMIT_HASH" ];
then
NEW_VERSION=`git diff -U0 $LAST_VALIDATED_COMMIT_HASH package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || :
if [ -n "$NEW_VERSION" ];
then
git tag v$NEW_VERSION
git push --tags
fi
fi
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Version tags only

name: Publish

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
env:
# Ensure release notes are published by our `serverless-ci` bot
# (If instead we'd use unconditionally provided secrets.GITHUB_TOKEN then
# "github-actions" user will be listed as release publisher)
GITHUB_TOKEN: ${{ secrets.USER_GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Retrieve dependencies from cache
uses: actions/cache@v2
with:
path: |
~/.npm
node_modules
key: npm-v14-${{ runner.os }}-refs/heads/master-${{ hashFiles('package.json') }}

- name: Install Node.js and npm
uses: actions/setup-node@v1
with:
node-version: 14.x
registry-url: https://registry.npmjs.org

- name: Publish new version
# Note: Setting NODE_AUTH_TOKEN as job|workspace wide env var won't work
# as it appears actions/setup-node sets own value
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish

# Normally we have a guarantee that deps are already there, still it may not be the case when:
# - `master` build for same commit failed (and we still pushed tag manually)
# - We've pushed tag manually before `master` build finalized
- name: Install dependencies
if: steps.cacheNpm.outputs.cache-hit != 'true'
run: |
npm update --no-save
npm update --save-dev --no-save
- name: Publish release notes
run: |
TEMP_ARRAY=($(echo $GITHUB_REF | tr "/" "\n"))
TAG=${TEMP_ARRAY[@]: -1}
npx github-release-from-cc-changelog $TAG
Loading