Skip to content

Commit

Permalink
ci: run all tests in one group
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Sep 25, 2024
1 parent 77a3b09 commit 65ead60
Showing 1 changed file with 6 additions and 55 deletions.
61 changes: 6 additions & 55 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,6 @@ on:
- v0.34.x-celestia

jobs:
split-test-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.23.1"
- name: Create a file with all the pkgs
run: go list ./... > pkgs.txt
- name: Split pkgs into 4 files
run: split -d -n l/4 pkgs.txt pkgs.txt.part.
# cache multiple
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-00"
path: ./pkgs.txt.part.00
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-01"
path: ./pkgs.txt.part.01
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-02"
path: ./pkgs.txt.part.02
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-03"
path: ./pkgs.txt.part.03

build-linux:
name: Build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -62,11 +33,8 @@ jobs:

tests:
runs-on: ubuntu-latest
needs: split-test-files
strategy:
fail-fast: false
matrix:
part: ["00", "01", "02", "03"]
fail-fast: true
steps:
- uses: actions/setup-go@v5
with:
Expand All @@ -78,18 +46,13 @@ jobs:
**/**.go
go.mod
go.sum
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-${{ matrix.part }}"
if: env.GIT_DIFF
- name: test & coverage report creation
run: |
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 15m -race -coverprofile=${{ matrix.part }}profile.out -covermode=atomic
run: go test ./... -mod=readonly -timeout 15m -race -coverprofile=profile.out -covermode=atomic
if: env.GIT_DIFF
- uses: actions/upload-artifact@v4
with:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
name: "${{ github.sha }}-coverage"
path: ./profile.out

upload-coverage-report:
runs-on: ubuntu-latest
Expand All @@ -104,22 +67,10 @@ jobs:
go.sum
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-00-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-01-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-02-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v4.1.8
with:
name: "${{ github.sha }}-03-coverage"
name: "${{ github.sha }}-coverage"
if: env.GIT_DIFF
- run: |
cat ./*profile.out | grep -v "mode: atomic" >> coverage.txt
cat ./profile.out | grep -v "mode: atomic" >> coverage.txt
if: env.GIT_DIFF
- uses: codecov/codecov-action@v4
with:
Expand Down

0 comments on commit 65ead60

Please sign in to comment.