mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-21 07:21:40 -04:00
Currently go-test and go-validate only run for users who have push access to the Packer repo. We want to ensure tests and validation run for all opened pull requests including public forks.
48 lines
1.0 KiB
YAML
48 lines
1.0 KiB
YAML
#
|
|
# This GitHub action runs Packer go tests across
|
|
# Windows, Linux, and MacOS runners.
|
|
#
|
|
|
|
name: "Go Test"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
pull_request:
|
|
|
|
env:
|
|
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
linux-go-tests:
|
|
runs-on: ubuntu-latest
|
|
name: Linux go tests
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '1.18'
|
|
- 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.18'
|
|
- 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.18'
|
|
- run: go test ./... -coverprofile=coverage.txt -covermode=atomic
|