Files
Packer-Cn/.github/workflows/go-test.yml
Wilken Riveraandneilnaveen cc5898022a update action permissions (#11837)
* chore: Set permissions for GitHub actions

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: neilnaveen <[email protected]>

* Update permissions for newly added actions

* Remove deleted actions

Co-authored-by: neilnaveen <[email protected]>
2022-06-14 12:08:39 -04:00

43 lines
1022 B
YAML

#
# This GitHub action runs Packer go tests across
# Windows, Linux, and MacOS runners.
#
name: "Go Test"
on: [ workflow_dispatch, push ]
env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
jobs:
linux-go-tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/ghcri/golang:1.17
name: Linux go tests
steps:
- uses: actions/checkout@v2
- run: TESTARGS="-coverprofile=coverage.txt -covermode=atomic" make ci
darwin-go-tests:
runs-on: macos-latest
name: Darwin go tests
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- run: go test ./... -coverprofile=coverage.txt -covermode=atomic
windows-go-tests:
runs-on: windows-latest
name: Windows go tests
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- run: go test ./... -coverprofile=coverage.txt -covermode=atomic