Skip to content

Modify scripts for login, creating a form, and voting #13

Modify scripts for login, creating a form, and voting

Modify scripts for login, creating a form, and voting #13

Workflow file for this run

name: Go Unit Tests
on:
push:
branches: [main]
pull_request:
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Use Go >= 1.19
uses: actions/setup-go@v3
with:
go-version: '>=1.19'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Run lint
run: make lint
- name: Run vet
run: make vet
- name: Test all, except integration, with coverage
run: |
go test -json -covermode=count -coverprofile=profile.cov $(go list ./... | grep -v /integration) 2>&1 | tee report.json
- name: Sonarcloud scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.organization=dedis
-Dsonar.projectKey=dedis_d-voting
-Dsonar.go.tests.reportPaths=report.json
-Dsonar.go.coverage.reportPaths=profile.cov
-Dsonar.coverage.exclusions=**/*_test.go,/internal/**/*
-Dsonar.issue.ignore.multicriteria=e1
-Dsonar.issue.ignore.multicriteria.e1.ruleKey=*Naming*
-Dsonar.issue.ignore.multicriteria.e1.resourceKey=**/*_test.go
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
parallel: true
# notifies that all test jobs are finished.
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true