-
Notifications
You must be signed in to change notification settings - Fork 8
48 lines (41 loc) · 1.2 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# GitHub Actions - CI for Go with just builders and tests.
# https://github.com/x448/float16/blob/master/.github/workflows/ci.yml
# Use cover.yml for coverage and safer-golangci-lint.yml for linting.
name: ci
on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'
tags:
- 'v*'
# Revoke default permissions.
permissions: {}
jobs:
# Test on various OS and go versions.
tests:
name: test ${{matrix.os}} go-${{ matrix.go-version }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
go-version: [1.17, 1.22, 1.23] # oldest supported version and latest 2 versions
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build project
run: go build ./...
- name: Run tests
run: |
go version
go test -short -race -v ./...