Add triggers for push and workflow_dispatch #1
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
name: Go2Chef | ||
on: | ||
pull_request: | ||
push: | ||
workflow:dispatch: | ||
jobs: | ||
build: | ||
name: Test + Build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- name: Set up Go 1.16 | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.16 | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
- name: Test on Windows | ||
if: runner.os == 'windows' | ||
run: go test ./... | ||
- name: Test on POSIX | ||
if: runner.os != 'windows' | ||
run: make test | ||
- name: Build on Windows | ||
if: runner.os == 'windows' | ||
run: ./scripts/build.sh | ||
env: | ||
GOOS: windows | ||
GOARCH: amd64 | ||
shell: bash | ||
- name: Build on OSX | ||
if: runner.os == 'macos' | ||
run: make darwin | ||
- name: Build on Linux | ||
if: runner.os == 'linux' | ||
run: make linux | ||