fix(ci): Fix missing permissions for release workflow #343
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
# SPDX-FileCopyrightText: 2023-2024 Steffen Vogel <[email protected]> | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Test | |
on: | |
- push | |
- pull_request | |
jobs: | |
integration: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- name: Install Go dependencies | |
run: | | |
go install github.com/onsi/ginkgo/v2/ginkgo | |
- name: Install system dependencies | |
run: sudo apt-get install -y | |
libpcap-dev | |
- name: Run integration tests | |
run: sudo --preserve-env env "PATH=$PATH" | |
ginkgo run | |
-r | |
--label-filter='integration' | |
--procs=4 | |
--compilers=4 | |
--randomize-all | |
--randomize-suites | |
--keep-going | |
--cover | |
--coverpkg=./... | |
--coverprofile=integration_cover.profile | |
--race | |
--trace | |
--json-report=report.json | |
--timeout=10m | |
env: | |
# Pass token via environment variable to avoid GitHub API rate-limit | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Report integration test coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: integration_cover.profile | |
flags: integration | |
unit: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- name: Install Go dependencies | |
run: | | |
go install github.com/onsi/ginkgo/v2/ginkgo | |
- name: Install system dependencies | |
run: sudo apt-get install -y | |
libpcap-dev | |
- name: Run unit tests | |
run: ginkgo run | |
-r | |
--label-filter='!integration' | |
--procs=4 | |
--compilers=4 | |
--randomize-all | |
--randomize-suites | |
--keep-going | |
--cover | |
--coverpkg=./... | |
--coverprofile=unit_cover.profile | |
--race | |
--trace | |
--json-report=report.json | |
--timeout=10m | |
- name: Report unit test coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: unit_cover.profile | |
flags: unit |