Update github-actions #211
Workflow file for this run
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: VOPRF | |
on: | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
github.com:443 | |
objects.githubusercontent.com:443 | |
proxy.golang.org:443 | |
raw.githubusercontent.com:443 | |
- name: Checkout repo | |
uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a | |
with: | |
go-version-file: ./go.mod | |
# Linting | |
- name: Linting | |
uses: golangci/golangci-lint-action@0e1fd32b0c0584f0d28eec08848dfd2bf6a909d9 | |
with: | |
version: latest | |
args: --config=./.github/.golangci.yml ./... | |
only-new-issues: true | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
go: [ '1.22', '1.21' ] | |
steps: | |
- uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
github.com:443 | |
proxy.golang.org:443 | |
storage.googleapis.com:443 | |
sum.golang.org:443 | |
- name: Checkout repo | |
uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a | |
with: | |
go-version: ${{ matrix.go }} | |
# Test | |
- name: Run Tests | |
run: cd .github && make test | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
steps: | |
- uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.codecov.io:443 | |
api.github.com:443 | |
cli.codecov.io:443 | |
ea6ne4j2sb.execute-api.eu-central-1.amazonaws.com:443 | |
github.com:443 | |
objects.githubusercontent.com:443 | |
proxy.golang.org:443 | |
scanner.sonarcloud.io:443 | |
sonarcloud.io:443 | |
storage.googleapis.com:443 | |
- name: Checkout repo | |
uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a | |
with: | |
go-version-file: ./go.mod | |
# Coverage | |
- name: Run coverage | |
run: cd .github && make cover | |
# Codecov | |
- name: Codecov | |
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
file: .github/coverage.out | |
# Sonar | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@02ef91109b2d589e757aefcfb2854c2783fd7b19 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.organization=bytemare | |
-Dsonar.projectKey=voprf | |
-Dsonar.go.coverage.reportPaths=.github/coverage.out | |
-Dsonar.sources=. | |
-Dsonar.test.exclusions=examples_test.go,tests/** | |
-Dsonar.coverage.exclusions=examples_test.go,tests/** | |
-Dsonar.tests=tests/ | |
-Dsonar.verbose=true |