feat: add support for custom region in deploy
executor
#36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- README.md | |
- docs/*.md | |
- .vscode/** | |
- CHANGELOG.md | |
- '**/CHANGELOG.md' | |
pull_request: | |
branches: | |
- main | |
types: | |
- ready_for_review | |
- opened | |
- reopened | |
- synchronize | |
paths-ignore: | |
- README.md | |
- docs/*.md | |
- .vscode/** | |
- CHANGELOG.md | |
- '**/CHANGELOG.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-test | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16, 18] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# We need to fetch all branches and commits so that Nx affected has a base to compare against. | |
fetch-depth: 0 | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
id: set-shas | |
uses: nrwl/nx-set-shas@v3 | |
- name: Setup | |
uses: ./.github/actions/setup | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Test | |
uses: ./.github/actions/test | |
with: | |
from: ${{ steps.set-shas.outputs.base }} | |
heroku-api-key: ${{ secrets.HEROKU_API_KEY }} | |
heroku-email: ${{ secrets.HEROKU_EMAIL }} | |
- name: Check tests coverage reports existence | |
id: has-coverage | |
uses: andstor/file-existence-action@v2 | |
with: | |
files: coverage | |
- name: Merge coverage reports | |
if: steps.has-coverage.outputs.files_exists == 'true' | |
run: node tools/merge-coverage.js -c coverage | |
# should be uploaded only once theoretically... | |
- name: Upload merged coverage reports | |
if: steps.has-coverage.outputs.files_exists == 'true' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: coverage | |
retention-days: 5 | |
outputs: | |
has-coverage: ${{ steps.has-coverage.outputs.files_exists }} | |
scan: | |
runs-on: ubuntu-latest | |
needs: [test] | |
# TODO: move in separate workflow | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Shallow clones should be disabled for a better relevancy of Sonar analysis | |
fetch-depth: 0 | |
# for now we just have one lib in the monorepo, so we can just use its version to qualify the sonar quality gate new code | |
- name: Get nx-heroku version | |
id: nx-heroku-version | |
uses: martinbeentjes/npm-get-version-action@main | |
with: | |
path: packages/nx-heroku | |
- name: Download merged coverage reports | |
if: needs.test.outputs.has-coverage == 'true' | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage | |
path: coverage | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.projectVersion=${{ steps.nx-heroku-version.outputs.current-version }} | |
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info |