Files
Packer-Cn/.github/workflows/go-test.yml
Wilken Rivera a7c37ee34d Add tests for the packer plugins subcommand (#11660)
* Add tests for plugins install command

* Add tests for plugins remove command

* Add PACKER_GITHUB_API_TOKEN to all test env

* Update dir hashes for non-darwin os

* Update tests with feedback from review
2022-03-15 16:32:49 -04:00

40 lines
991 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 }}
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