Skip to content

chore: Integrate coveralls.io #80

chore: Integrate coveralls.io

chore: Integrate coveralls.io #80

Workflow file for this run

name: Tests

Check failure on line 1 in .github/workflows/tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/tests.yml

Invalid workflow file

(Line: 120, Col: 9): There's not enough info to determine what you meant. Add one of these properties: run, shell, uses, with, working-directory
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
cache-dependency-path: "**/*.sum"
- run: make install-tools
- run: make checks
utest:
needs:
- checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
cache-dependency-path: "**/*.sum"
- run: make install-tools
- run: make install-fabric-bins
- name: unit-tests
env:
GO_TEST_PARAMS: "-race -coverprofile=coverage.profile"
run: make unit-tests
- uses: coverallsapp/github-action@v2
with:
flag-name: utest
parallel: true
utest-postgres:
needs:
- checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
cache-dependency-path: "**/*.sum"
- run: make install-tools
- run: make testing-docker-images
- name: unit-tests-postgres
env:
GO_TEST_PARAMS: "-race -coverprofile=coverage.profile"
run: make unit-tests-postgres
- uses: coverallsapp/github-action@v2
with:
flag-name: utest-postgres
parallel: true
itest-list:
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.set-itest-tests.outputs.tests }}
all-tests: ${{ steps.set-all-tests.outputs.all-tests }}
steps:
- uses: actions/checkout@v5
- name: list itest targets
id: set-itest-tests
run: |
echo "tests=$(make list-integration-tests | jq -R . | jq -s -c .)" >> $GITHUB_OUTPUT
- name: build carryforward string
id: set-all-tests
run: |
itests=$(make list-integration-tests | sed 's/^/itest-/' | paste -sd "," -)
echo "all-tests=utest,utest-postgres,$itests" >> $GITHUB_OUTPUT
itest:
needs:
- checks
- itest-list
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# run all test as listed via `make list-integration-tests`
tests: ${{ fromJson(needs.itest-list.outputs.tests) }}
steps:
- run: docker version
- name: Set up Docker
uses: docker/setup-docker-action@v4
with:
version: 28.5.2 # we pin the docker version temporary until the release of fabric v3.1.4
set-host: true
- run: docker version
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: "go.mod"
cache-dependency-path: "**/*.sum"
- run: make install-tools
- run: make install-fabric-bins
- run: make docker-images
- name: Set up Fabric-x
if: startsWith(matrix.tests, 'fabricx')
run: |
make install-fxconfig install-configtxgen fabricx-docker-images
- name: Set up Softhsm
# we only need this for a subset of integration tests
if: endsWith(matrix.tests, 'hsm')
run: |
make install-softhsm
./ci/scripts/setup_softhsm.sh
- name: Run Integration test ${{ matrix.tests }}
- run: |
mkdir -p covdata
GOCOVERDIR=covdata \
make integration-tests-${{ matrix.tests }}
go tool covdata textfmt -i=covdata -o coverage.profile
- uses: coverallsapp/github-action@v2
with:
flag-name: itest-${{ matrix.tests }}
parallel: true
finish:
needs:
- utest
- utest-postgres
- itest
runs-on: ubuntu-latest
steps:
- uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: ${{ needs.itest-list.outputs.all-tests }}