Merge pull request #28 from dedis/fix-module #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test on push | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
test_and_coverage: | |
strategy: | |
matrix: | |
platform: [macos-latest, windows-latest, ubuntu-latest] | |
runs-on: ${{matrix.platform}} | |
env: | |
DBGSYNCLOG: trace | |
DBGSYNCON: true | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Set up Go 1.21 | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Test without coverage | |
if: matrix.platform == 'macos-latest' || matrix.platform == 'windows-latest' | |
run: make test | |
- name: Test with coverage | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
make coverage | |
cp channel/report.json report.json | |
cat sync/report.json >> report.json | |
cp channel/profile.cov profile.cov | |
tail -n +2 sync/profile.cov >> profile.cov | |
- name: SonarCloud scan | |
if: matrix.platform == 'ubuntu-latest' | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.organization=dedis | |
-Dsonar.projectKey=dedis_debugtools | |
-Dsonar.go.tests.reportPaths=report.json | |
-Dsonar.go.coverage.reportPaths=profile.cov | |
-Dsonar.pullrequest.key=${{ github.event.number }} | |
-Dsonar.pullrequest.branch=${{ github.head_ref }} | |
-Dsonar.pullrequest.base=${{ github.event.pull_request.base }} | |
- name: Send coverage | |
if: matrix.platform == 'ubuntu-latest' | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
path-to-profile: profile.cov |