CI: build on true ms windows and run using bash #76
Workflow file for this run
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: build # this string appears on badge | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
name: "Go ${{ matrix.go }} build and behavioral tests" | |
strategy: | |
matrix: | |
go: | |
- "1.18" | |
- "1.19" | |
- "1.20" | |
- "1.21" | |
- "1.22" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "${{ matrix.go }}" | |
- run: "go version" | |
- run: "go build ./cmd/..." | |
- run: "./behavioral-tests/run.sh" | |
x-build-windows: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
name: "Simple build on MS Windows" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- run: "go version" | |
- run: "go build ./cmd/..." | |
env: | |
GOOS: windows | |
GOARCH: amd64 | |
- run: "file pplog.exe" | |
windows: | |
runs-on: windows-latest | |
timeout-minutes: 10 | |
name: "Build on MS Windows" | |
steps: | |
- uses: actions/checkout@v4 | |
- run: "go version" # go1.21.11 # https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md | |
- run: "go build ./cmd/..." | |
- run: "dir" | |
- run: "./pplog.exe -v" | |
- shell: bash | |
run: "./pplog.exe echo '{\"time\":\"2024-06-12T12:00:00Z\",\"level\":\"INFO\",\"msg\":\"Hello\"}'" | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
name: "Unit test and lint" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
version: "v1.59" | |
- run: "go test -v -race -coverprofile=coverage.txt -covermode=atomic ./..." | |
env: | |
GOEXPERIMENT: nocoverageredesign | |
- uses: codecov/codecov-action@v4 | |
with: | |
files: ./coverage.txt | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} # required |