build(deps): bump node in /.docker in the all-containers group (#927) #307
This file contains hidden or 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
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
| name: trunk | |
| on: | |
| push: | |
| branches: [main] | |
| defaults: | |
| run: | |
| shell: bash | |
| concurrency: | |
| group: ${{ github.ref_name }}.${{ github.sha }}.trunk | |
| cancel-in-progress: true | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changes: ${{ steps.check-changes.outputs.changes }} | |
| deploy: ${{ steps.check-changes.outputs.deploy }} | |
| origin: ${{ steps.check-origin.outputs.origin }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup environment | |
| uses: ./.github/actions/setup-environment | |
| - name: Check changes | |
| id: check-changes | |
| uses: ./.github/actions/check-changes | |
| - name: Check origin | |
| id: check-origin | |
| uses: ./.github/actions/check-origin | |
| trunk: | |
| needs: checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Setup environment | |
| if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' || fromJSON(needs.checks.outputs.changes).shelltools == 'true' }} | |
| uses: ./.github/actions/setup-environment | |
| with: | |
| compodoc: true | |
| cypress: true | |
| firebase-tools: true | |
| - name: Lint shell | |
| if: fromJSON(needs.checks.outputs.changes).shelltools == 'true' | |
| run: | | |
| sudo apt install shellcheck | |
| npx nx run tools:lint-shell | |
| - name: Lint ts | |
| if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| run: npx nx run-many --target lint --all | |
| - name: Lint html | |
| if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| run: npx nx run-many --target prettier-check --dryRun --all | |
| - name: Lint scss | |
| if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| run: npx nx run-many --target stylelint-check --dryRun --all | |
| - name: Unit test | |
| if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| run: | | |
| npx nx run-many --target test --all --pass-with-no-tests --coverage | |
| npx nx run tools:coverage-stats | |
| cat ./UNIT_COVERAGE.md >> $GITHUB_STEP_SUMMARY | |
| - name: Build | |
| if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| run: | | |
| SKIP_FORMAT="true" yarn generate:env:documentation | |
| npx nx run-many --target configure-env --all --parallel 1 | |
| npx nx run-many --target build --all --parallel 1 --configuration production | |
| npx nx run-many --target configure-env --all --parallel 1 --reset | |
| - name: Documentation assets | |
| if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| run: | | |
| bash tools/shell/test.sh reports || exit 1 | |
| yarn generate:unit-test-coverage-index | |
| npx nx run tools:compodoc-build | |
| cp -r ./dist/compodoc ./dist/apps/documentation/browser/assets | |
| yarn generate:changelog | |
| npx nx run-many --target e2e --all --parallel 1 || true | |
| bash tools/shell/e2e.sh reports || exit 1 | |
| yarn generate:e2e-test-report-index | |
| - name: Upload dist artifact | |
| if: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| uses: ./.github/actions/dist-artifact-upload | |
| - name: Dispatch package publishing | |
| if: ${{ needs.checks.outputs.origin == 'true' && fromJSON(needs.checks.outputs.changes).packages == 'true' }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| REPO: ${{ github.repository }} | |
| EVENT_TYPE: publish_packages | |
| run: | | |
| gh api \ | |
| -X POST \ | |
| /repos/${REPO}/dispatches \ | |
| --header 'Accept: application/vnd.github+json' \ | |
| --input - <<EOF | |
| { | |
| "event_type": "${EVENT_TYPE}" | |
| } | |
| EOF | |
| - name: Cleanup | |
| run: rm -rf ./.env ./functions/.env | |
| deploy-apps: | |
| needs: [checks, trunk] | |
| if: ${{ needs.checks.outputs.origin == 'true' && fromJSON(needs.checks.outputs.changes).deploy == 'true' }} | |
| uses: ./.github/workflows/deploy-apps.yml | |
| secrets: inherit | |
| with: | |
| api: false # This only works with a paid plan such as Blaze (https://firebase.google.com/pricing/) | |
| client: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| elements: ${{ fromJSON(needs.checks.outputs.changes).dependencies == 'true' || fromJSON(needs.checks.outputs.changes).src == 'true' }} | |
| documentation: ${{ fromJSON(needs.checks.outputs.changes).deploy == 'true' }} | |
| publish-packages: | |
| needs: [checks, trunk] | |
| if: ${{ needs.checks.outputs.origin == 'true' && fromJSON(needs.checks.outputs.changes).packages == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: write | |
| id-token: write | |
| steps: | |
| - name: Publish Packages | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| REPO: ${{ github.repository }} | |
| BRANCH: ${{ github.head_ref }} | |
| EVENT_TYPE: publish_packages | |
| PUBLISH_CLIENT_D3_CHARTS: ${{ fromJSON(needs.checks.outputs.changes).packageCharts == 'true' }} | |
| PUBLISH_CLIENT_GUIDED_TOUR: ${{ fromJSON(needs.checks.outputs.changes).packageGuidedTour == 'true' }} | |
| PUBLISH_CLIENT_PWA_OFFLINE: ${{ fromJSON(needs.checks.outputs.changes).packagePwaOffline == 'true' }} | |
| PUBLISH_CLIENT_UTIL_ELIZA: ${{ fromJSON(needs.checks.outputs.changes).packageEliza == 'true' }} | |
| PUBLISH_BACKEND_DIAGNOSTICS: ${{ fromJSON(needs.checks.outputs.changes).packageBackendDiagnostics == 'true' }} | |
| run: | | |
| gh api \ | |
| -X POST \ | |
| /repos/${REPO}/dispatches \ | |
| --header 'Accept: application/vnd.github+json' \ | |
| --input - <<EOF | |
| { | |
| "event_type": "${EVENT_TYPE}", | |
| "client_payload": { | |
| "ref": "${BRANCH}", | |
| "publish-client-d3-charts": "${PUBLISH_CLIENT_D3_CHARTS}", | |
| "publish-client-guided-tour": "${PUBLISH_CLIENT_GUIDED_TOUR}", | |
| "publish-client-pwa-offline": "${PUBLISH_CLIENT_PWA_OFFLINE}", | |
| "publish-client-util-eliza": "${PUBLISH_CLIENT_UTIL_ELIZA}", | |
| "publish-backend-diagnostics": "${PUBLISH_BACKEND_DIAGNOSTICS}" | |
| } | |
| } | |
| EOF |