ci: bump gh actions components versions to the latest ones #146
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: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
GO111MODULE: on | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [ linux, darwin, windows ] | |
include: | |
- build: linux | |
os: ubuntu-latest | |
- build: darwin | |
os: macos-latest | |
- build: windows | |
os: windows-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22" | |
id: go | |
- name: Install gox | |
run: go install github.com/mitchellh/gox@latest | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Build | |
run: gox -osarch="${{ matrix.build }}/amd64" -ldflags "-s -w -X github.com/aegoroff/dirstat/internal/cmd.Version=v1.0.${{ github.run_number }}-dev" github.com/aegoroff/dirstat | |
- name: Test with coverage | |
if: matrix.build == 'linux' | |
run: go test -coverprofile=coverage.txt -coverpkg github.com/aegoroff/dirstat/internal/cmd,github.com/aegoroff/dirstat/scan,github.com/aegoroff/dirstat/internal/module,github.com/aegoroff/dirstat/internal/out -covermode=atomic github.com/aegoroff/dirstat/... | |
- name: Test | |
if: matrix.build != 'linux' | |
run: go test ./... | |
- name: Static analysis | |
uses: dominikh/staticcheck-action@v1.3.0 | |
with: | |
version: "2022.1.3" | |
install-go: true | |
- name: Send coverage | |
if: matrix.build == 'linux' | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -t ${{ env.CODECOV_TOKEN }} | |