CI #5421
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: | |
- '*' | |
pull_request: | |
branches: | |
- 'main' | |
schedule: | |
- cron: '0 0 * * *' | |
env: | |
NX_CLOUD_DISTRIBUTED_EXECUTION: true | |
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_TOKEN }} | |
jobs: | |
main: | |
name: Nx Cloud - Main Job | |
uses: nrwl/ci/.github/workflows/[email protected] | |
with: | |
node-version: '20' | |
parallel-commands-on-agents: | | |
pnpm nx affected --target=lint --parallel=3 | |
pnpm nx affected --target=test --parallel=3 | |
pnpm nx affected --target=build --parallel=3 --exclude=docs | |
NODE_NO_WARNINGS=1 pnpm exec nx affected --target=e2e --skip-nx-cache | |
report-coverage: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'pull_request' && github.repository == 'jmcdo29/ogma' && github.actor == 'jmcdo29' }} | |
continue-on-error: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install pnpm | |
run: npm i -g pnpm@^8 | |
- name: Install deps | |
run: pnpm i | |
- name: Collect Test Coverage | |
run: NX_CLOUD_DISTRIBUTED_EXECUTION=false NODE_NO_WARNINGS=1 pnpm nx run tools:collect --skip-nx-cache | |
- name: Send Test Coverage:with | |
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage/lcov.info | |
shell: bash | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ['javascript'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v2 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
auto-merge: | |
needs: main | |
if: (contains(github.event.pull_request.user.login, 'dependabot') || contains(github.event.pull_request.user.login, 'renovate')) && github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: automerge | |
uses: pascalgn/[email protected] | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
MERGE_LABELS: '' | |
MERGE_METHOD: rebase | |
agents: | |
name: Nx Cloud - Agents | |
uses: nrwl/ci/.github/workflows/[email protected] | |
with: | |
number-of-agents: 3 | |
node-version: '20' |