diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index 4ee8c0a..f404827 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -11,33 +11,14 @@ env: FORCE_COLOR: 1 jobs: - linuxNode14: - name: '[Linux] Node.js 14: Unit tests ' + + linuxNode20: + name: '[Linux] Node.js 20: 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 @@ -45,8 +26,13 @@ jobs: path: | ~/.npm node_modules - key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} - restore-keys: npm-v14-${{ runner.os }}-${{ github.ref }}- + key: npm-v20-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} + restore-keys: npm-v20-${{ runner.os }}-${{ github.ref }}- + + - name: Install Node.js and npm + uses: actions/setup-node@v1 + with: + node-version: 20.x - name: Install dependencies if: steps.cacheNpm.outputs.cache-hit != 'true' @@ -56,8 +42,8 @@ jobs: - name: Unit tests run: npm test - linuxNode16: - name: '[Linux] Node.js 16: Unit tests' + linuxNode18: + name: '[Linux] Node.js 18: Unit tests' runs-on: ubuntu-latest steps: - name: Checkout repository @@ -70,13 +56,13 @@ jobs: path: | ~/.npm node_modules - key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} - restore-keys: npm-v16-${{ runner.os }}-${{ github.ref }}- + key: npm-v18-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} + restore-keys: npm-v18-${{ runner.os }}-${{ github.ref }}- - name: Install Node.js and npm uses: actions/setup-node@v1 with: - node-version: 16.x + node-version: 18.x - name: Install dependencies if: steps.cacheNpm.outputs.cache-hit != 'true' @@ -86,8 +72,8 @@ jobs: - name: Unit tests run: npm test - linuxNode12: - name: '[Linux] Node.js 12: Unit tests' + linuxNode16: + name: '[Linux] Node.js 16: Unit tests' runs-on: ubuntu-latest steps: - name: Checkout repository @@ -100,13 +86,13 @@ jobs: path: | ~/.npm node_modules - key: npm-v12-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} - restore-keys: npm-v12-${{ runner.os }}-${{ github.ref }}- + 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: 12.x + node-version: 16.x - name: Install dependencies if: steps.cacheNpm.outputs.cache-hit != 'true' @@ -116,13 +102,33 @@ jobs: - name: Unit tests run: npm test - linuxNode10: - name: '[Linux] Node.js v10: Unit tests' +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 @@ -130,15 +136,8 @@ jobs: 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 + 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' @@ -151,7 +150,7 @@ jobs: tagIfNewVersion: name: ubuntu-latest runs-on: ubuntu-latest - needs: [linuxNode14, linuxNode16, linuxNode12, linuxNode10] + needs: [linuxNode20, linuxNode18, linuxNode16, linuxNode14] timeout-minutes: 30 # Default is 360 steps: - name: Checkout repository diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ea702d0..53d624f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,12 +26,12 @@ jobs: path: | ~/.npm node_modules - key: npm-v14-${{ runner.os }}-refs/heads/master-${{ hashFiles('package.json') }} + key: npm-v20-${{ runner.os }}-refs/heads/master-${{ hashFiles('package.json') }} - name: Install Node.js and npm uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 20.x registry-url: https://registry.npmjs.org - name: Publish new version diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 90b3fe3..59dadeb 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -11,23 +11,13 @@ env: FORCE_COLOR: 1 jobs: - linuxNode14: - name: '[Linux] Node.js 14: Lint, Formatting, Eventual Commitlint, Eventual Changelog, Unit tests' + + linuxNode20: + name: '[Linux] Node.js 20: Unit tests' runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - with: - # For commitlint purpose ensure to have complete list of PR commits - # It's loose and imperfect assumption that PR has no more than 30 commits - fetch-depth: 30 - - - name: Retrieve last master commit (for `git diff` purposes) - run: | - git checkout -b pr - git fetch --prune --depth=30 origin +refs/heads/master:refs/remotes/origin/master - git checkout master - git checkout pr - name: Retrieve dependencies from cache id: cacheNpm @@ -36,40 +26,26 @@ jobs: path: | ~/.npm node_modules - key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} + key: npm-v20-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} restore-keys: | - npm-v14-${{ runner.os }}-${{ github.ref }}- - npm-v14-${{ runner.os }}-refs/heads/master- + npm-v20-${{ runner.os }}-${{ github.ref }}- + npm-v20-${{ runner.os }}-refs/heads/master- - name: Install Node.js and npm uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 20.x - name: Install dependencies if: steps.cacheNpm.outputs.cache-hit != 'true' run: | npm update --no-save npm update --save-dev --no-save - - name: Validate formatting - run: npm run prettier-check:updated - - name: Validate lint rules - run: npm run lint:updated - - name: Validate commit messages - if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id - run: npx commitlint -f master - - name: Validate changelog (if new version) - run: | - NEW_VERSION=`git diff -U0 master package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || : - if [ -n "$NEW_VERSION" ]; - then - npx dump-release-notes-from-cc-changelog $NEW_VERSION - fi - name: Unit tests run: npm test - linuxNode16: - name: '[Linux] Node.js 16: Unit tests' + linuxNode18: + name: '[Linux] Node.js v18: Unit tests' runs-on: ubuntu-latest steps: - name: Checkout repository @@ -82,15 +58,15 @@ jobs: path: | ~/.npm node_modules - key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} + key: npm-v18-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} restore-keys: | - npm-v16-${{ runner.os }}-${{ github.ref }}- - npm-v16-${{ runner.os }}-refs/heads/master- + npm-v18-${{ runner.os }}-${{ github.ref }}- + npm-v18-${{ runner.os }}-refs/heads/master- - name: Install Node.js and npm uses: actions/setup-node@v1 with: - node-version: 16.x + node-version: 18.x - name: Install dependencies if: steps.cacheNpm.outputs.cache-hit != 'true' @@ -100,8 +76,8 @@ jobs: - name: Unit tests run: npm test - linuxNode12: - name: '[Linux] Node.js 12: Unit tests' +linuxNode16: + name: '[Linux] Node.js 16: Unit tests' runs-on: ubuntu-latest steps: - name: Checkout repository @@ -114,15 +90,15 @@ jobs: path: | ~/.npm node_modules - key: npm-v12-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} + key: npm-v16-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} restore-keys: | - npm-v12-${{ runner.os }}-${{ github.ref }}- - npm-v12-${{ runner.os }}-refs/heads/master- + npm-v16-${{ runner.os }}-${{ github.ref }}- + npm-v16-${{ runner.os }}-refs/heads/master- - name: Install Node.js and npm uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 16.x - name: Install dependencies if: steps.cacheNpm.outputs.cache-hit != 'true' @@ -132,12 +108,23 @@ jobs: - name: Unit tests run: npm test - linuxNode10: - name: '[Linux] Node.js v10: Unit tests' + linuxNode14: + name: '[Linux] Node.js 14: Lint, Formatting, Eventual Commitlint, Eventual Changelog, Unit tests' runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 + with: + # For commitlint purpose ensure to have complete list of PR commits + # It's loose and imperfect assumption that PR has no more than 30 commits + fetch-depth: 30 + + - name: Retrieve last master commit (for `git diff` purposes) + run: | + git checkout -b pr + git fetch --prune --depth=30 origin +refs/heads/master:refs/remotes/origin/master + git checkout master + git checkout pr - name: Retrieve dependencies from cache id: cacheNpm @@ -146,20 +133,34 @@ jobs: path: | ~/.npm node_modules - key: npm-v10-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} + key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }} restore-keys: | - npm-v10-${{ runner.os }}-${{ github.ref }}- - npm-v10-${{ runner.os }}-refs/heads/master- + npm-v14-${{ runner.os }}-${{ github.ref }}- + npm-v14-${{ runner.os }}-refs/heads/master- - name: Install Node.js and npm uses: actions/setup-node@v1 with: - node-version: 10.x + node-version: 14.x - name: Install dependencies if: steps.cacheNpm.outputs.cache-hit != 'true' run: | npm update --no-save npm update --save-dev --no-save + - name: Validate formatting + run: npm run prettier-check:updated + - name: Validate lint rules + run: npm run lint:updated + - name: Validate commit messages + if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id + run: npx commitlint -f master + - name: Validate changelog (if new version) + run: | + NEW_VERSION=`git diff -U0 master package.json | grep '"version": "' | tail -n 1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"` || : + if [ -n "$NEW_VERSION" ]; + then + npx dump-release-notes-from-cc-changelog $NEW_VERSION + fi - name: Unit tests run: npm test diff --git a/provider/googleProvider.js b/provider/googleProvider.js index 00bbd85..da740f2 100644 --- a/provider/googleProvider.js +++ b/provider/googleProvider.js @@ -56,18 +56,22 @@ class GoogleProvider { cloudFunctionRuntime: { // Source: https://cloud.google.com/functions/docs/concepts/exec#runtimes enum: [ - 'nodejs6', // decommissioned - 'nodejs8', // deprecated - 'nodejs10', - 'nodejs12', 'nodejs14', - 'nodejs16', // recommended + 'nodejs16', + 'nodejs18', + 'nodejs20', // recommended 'python37', 'python38', 'python39', + 'python310', + 'python311', // recommended + 'python312', 'go111', 'go113', - 'go116', // recommended + 'go116', + 'go118', + 'go120', + 'go121', 'java11', 'dotnet3', 'ruby26',