Ci cd #8
Workflow file for this run
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: mono-repo | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: main | |
env: | |
UNINSTALL_URL: ${{vars.UNINSTALL_URL}} | |
TRACKING_ID: ${{vars.TRACKING_ID}} | |
OPTIONS_PAGE_URL: ${{vars.OPTIONS_PAGE_URL}} | |
FUNCTION_URL: ${{vars.FUNCTION_URL}} | |
VARIANT: ${{vars.VARIANT}} | |
DISCORD_CLIENT_ID: ${{vars.DISCORD_CLIENT_ID}} | |
NAME: ${{vars.NAME}} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
EnvSetup: | |
name: Setup Dynamic Environment Variables | |
runs-on: ubuntu-latest | |
environment: Development | |
outputs: | |
build-and-verify: ${{ steps.set-output-defaults.outputs.build-and-verify }} | |
steps: | |
- name: set outputs with default values | |
id: set-output-defaults | |
run: | | |
# If workflow_dispatch, use inputs (left), if other trigger, use default env (right) | |
echo "::set-output name=build-and-verify::${{ vars.VARIANT || 'true' }}" | |
main: | |
needs: [EnvSetup] | |
name: Nx Cloud - Main Job | |
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.13.0 | |
secrets: | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} | |
with: | |
parallel-commands: | | |
npx nx-cloud record -- npx nx format:check | |
artifacts-path: 'dist/apps/*' | |
environment-variables: | | |
VARIANT=${{needs.EnvSetup.outputs.build-and-verify}} | |
TEST=true | |
parallel-commands-on-agents: | | |
npx nx affected --target=lint --parallel=3 | |
npx nx affected --target=test --parallel=3 --ci --code-coverage | |
npx nx affected --target=build --parallel=3 | |
agents: | |
needs: [EnvSetup] | |
name: Nx Cloud - Agents | |
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.13.0 | |
secrets: | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} | |
with: | |
number-of-agents: 3 | |
environment-variables: | | |
UNINSTALL_URL=${{vars.UNINSTALL_URL}} | |
TRACKING_ID=${{vars.TRACKING_ID}} | |
OPTIONS_PAGE_URL=${{vars.OPTIONS_PAGE_URL}} | |
FUNCTION_URL=${{vars.FUNCTION_URL}} | |
VARIANT=${{vars.VARIANT}} | |
DISCORD_CLIENT_ID=${{vars.DISCORD_CLIENT_ID}} | |
NAME=${{vars.NAME}} | |
TEST=true |