feat: migrate to Nx 17 (#189) #366
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
pull-requests: write | |
issues: write | |
statuses: write | |
checks: write | |
contents: write | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: nrwl/nx-set-shas@v3 | |
- run: npm ci | |
- run: npx nx format:check | |
- run: npx nx affected --target=lint --parallel=3 | |
- run: npx nx affected --target=test --parallel=3 --ci --code-coverage --silent | |
- run: npx nx affected --target=build --parallel=3 | |
- run: | | |
echo "NO_COVERAGE_RUN=$(if [ -z "$(npx nx print-affected --select=projects)" ]; then echo "true"; else echo "false";fi)" >> $GITHUB_ENV | |
- name: Merge coverage | |
if: env.NO_COVERAGE_RUN != 'true' | |
run: | | |
node ./tools/scripts/coverageMerger.js | |
- name: Coveralls | |
if: env.NO_COVERAGE_RUN != 'true' | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release | |
if: ${{ success() && (github.event_name != 'pull_request' || github.event.action == 'closed' && github.event.pull_request.merged == true) }} | |
env: | |
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
HUSKY: '0' | |
run: | | |
npx nx affected --target release --parallel=false |