From 4534d42900554d20c648add1b2068bbc86c8a982 Mon Sep 17 00:00:00 2001 From: Molly Draven Date: Thu, 1 Aug 2024 08:31:40 -0400 Subject: [PATCH 1/2] Create pipeline to run full tests on main and development branches Fixes #42 --- .github/workflows/full_tests.yml | 56 ++++++++++++++++++++++++++++++++ Makefile | 3 ++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/full_tests.yml diff --git a/.github/workflows/full_tests.yml b/.github/workflows/full_tests.yml new file mode 100644 index 0000000..e0d7bd1 --- /dev/null +++ b/.github/workflows/full_tests.yml @@ -0,0 +1,56 @@ +name: CI + +on: + push: + branches: + - main + - develop + pull_request: + +permissions: + actions: read + contents: read + +jobs: + main: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: pnpm/action-setup@v2 + + # This enables task distribution via Nx Cloud + # Run this command as early as possible, before dependencies are installed + # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun + # Connect your workspace by running "nx connect" and uncomment this + # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + # env: + # NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} + # Cache node_modules + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "pnpm" + + - run: pnpm install --frozen-lockfile + - uses: nrwl/nx-set-shas@v4 + env: + NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} + # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud + # - run: pnpm exec nx-cloud record -- echo Hello World + # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected + - run: make test_all + env: + NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }} + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage reports to Codecov + run: make codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index 8a039e0..4b6957d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ test: pnpm exec nx affected -t lint test build +test_all: + pnpm exec nx run-many --target=test --all + codecov_install: pip install codecov-cli From 0ca7c00d7a185bff8025211332e2f814ebec0d8c Mon Sep 17 00:00:00 2001 From: Molly Draven Date: Thu, 1 Aug 2024 08:35:03 -0400 Subject: [PATCH 2/2] chore: Update CI workflow to include affected branches The CI workflow has been updated to include the affected branches for testing. Previously, only the `main` branch was included, but now both `main` and `develop` branches are included in the workflow. This change ensures that the CI pipeline runs tests on all relevant branches, improving the overall testing coverage. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4b3a45..e22dcf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,10 @@ -name: CI +name: Affected CI on: push: branches: - - main + - !main + - !develop pull_request: permissions: