Skip to content

Commit 02ab91e

Browse files
authored
*: parallel tests (#3622)
Run CI tests in parallel instead of sequentially. It's not possible to cancel a single job within a workflow, only entire workflows. source: https://github.com/orgs/community/discussions/67407. You may cancel/rerun any test workflow without affecting the others. category: misc ticket: #3209
1 parent 0bd161c commit 02ab91e

4 files changed

Lines changed: 98 additions & 78 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Compose Tests
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main*
7+
8+
concurrency:
9+
group: compose-tests-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
compose_tests:
14+
runs-on: charon-ci
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up QEMU
18+
id: qemu
19+
uses: docker/setup-qemu-action@v3
20+
- uses: docker/setup-buildx-action@v3
21+
with:
22+
driver-opts: "image=moby/buildkit:v0.10.5"
23+
- uses: ./.github/actions/setup-go
24+
- uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/go/pkg/mod
28+
~/.cache/go-build
29+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+
restore-keys: |
31+
${{ runner.os }}-go-
32+
- run: |
33+
echo "CHARON_REPO=$(pwd)" >> $GITHUB_ENV
34+
echo "DOCKER_BUILDKIT=1" >> $GITHUB_ENV
35+
- run: go test -race github.com/obolnetwork/charon/testutil/compose/smoke -v -integration -sudo-perms -timeout=20m -log-dir=.
36+
- uses: actions/upload-artifact@v4
37+
if: always()
38+
with:
39+
name: smoke-test-logs
40+
path: testutil/compose/smoke/*.log
41+
retention-days: 3
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Integration Tests
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main*
7+
8+
concurrency:
9+
group: integration-tests-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
integration_tests:
14+
runs-on: charon-ci
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: ./.github/actions/setup-go
18+
- uses: actions/cache@v4
19+
with:
20+
path: |
21+
~/go/pkg/mod
22+
~/.cache/go-build
23+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
24+
restore-keys: |
25+
${{ runner.os }}-go-
26+
- run: go test -v -timeout=10m -race github.com/obolnetwork/charon/testutil/integration -integration

.github/workflows/test.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.github/workflows/unit-tests.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Unit Tests
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main*
7+
8+
concurrency:
9+
group: unit-tests-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
unit_tests:
14+
runs-on: charon-ci
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: ./.github/actions/setup-go
18+
- uses: actions/cache@v4
19+
with:
20+
path: |
21+
~/go/pkg/mod
22+
~/.cache/go-build
23+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
24+
restore-keys: |
25+
${{ runner.os }}-go-
26+
- run: go test -coverprofile=coverage.out -covermode=atomic -timeout=5m -race ./...
27+
- name: Upload coverage to Codecov
28+
uses: codecov/codecov-action@v5.4.0
29+
with:
30+
token: ${{ secrets.CODECOV_TOKEN }}
31+
files: coverage.out

0 commit comments

Comments
 (0)