Skip to content

Commit

Permalink
Create pipeline to run full tests on main and development branches (#43)
Browse files Browse the repository at this point in the history
* Create pipeline to run full tests on main and development branches
Fixes #42

* 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.
  • Loading branch information
drazisil committed Aug 1, 2024
1 parent f7acc94 commit 5117f9b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: CI
name: Affected CI

on:
push:
branches:
- main
- !main
- !develop
pull_request:

permissions:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/full_tests.yml
Original file line number Diff line number Diff line change
@@ -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 }}
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 5117f9b

Please sign in to comment.