Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

set packer* repos version #97

set packer* repos version

set packer* repos version #97

Workflow file for this run

#
# This GitHub action runs Packer go tests across
# Windows, Linux, and MacOS runners.
#
name: "Go Test"
on:
push:
branches:
- 'main'
- release/**
pull_request:
env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
jobs:
get-go-version:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: 'Determine Go version'
id: get-go-version
run: |
echo "Found Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
linux-go-tests:
needs:
- get-go-version
runs-on: ubuntu-latest
name: Linux go tests
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: TESTARGS="-coverprofile=coverage.txt -covermode=atomic" make ci
darwin-go-tests:
needs:
- get-go-version
runs-on: macos-latest
name: Darwin go tests
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: go test ./... -coverprofile=coverage.txt -covermode=atomic
windows-go-tests:
needs:
- get-go-version
runs-on: windows-latest
name: Windows go tests
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: go test ./... -coverprofile=coverage.txt -covermode=atomic