| 1 |
name: Test |
| 2 |
on: [push, pull_request] |
| 3 |
jobs: |
| 4 |
build: |
| 5 |
strategy: |
| 6 |
matrix: |
| 7 |
go-version: [1.23.x, 1.25.x] |
| 8 |
platform: [windows-latest] |
| 9 |
runs-on: ${{ matrix.platform }} |
| 10 |
steps: |
| 11 |
- name: Install Go |
| 12 |
uses: actions/setup-go@v3 |
| 13 |
with: |
| 14 |
go-version: ${{ matrix.go-version }} |
| 15 |
- name: Checkout code |
| 16 |
uses: actions/checkout@v2 |
| 17 |
- name: Build |
| 18 |
run: | |
| 19 |
go build ./... |
| 20 |
- name: Run Windows Unit Tests |
| 21 |
run: | |
| 22 |
$env:GH_ACTION="TRUE" |
| 23 |
go test -v -race ./mount/... |
| 24 |
test: |
| 25 |
strategy: |
| 26 |
matrix: |
| 27 |
go-version: [1.23.x, 1.25.x] |
| 28 |
platform: [ubuntu-latest, macos-latest] |
| 29 |
runs-on: ${{ matrix.platform }} |
| 30 |
steps: |
| 31 |
- name: Install Go |
| 32 |
uses: actions/setup-go@v3 |
| 33 |
with: |
| 34 |
go-version: ${{ matrix.go-version }} |
| 35 |
- name: Checkout code |
| 36 |
uses: actions/checkout@v2 |
| 37 |
- name: Test |
| 38 |
run: | |
| 39 |
make test |
| 40 |
verify-go-directive: |
| 41 |
strategy: |
| 42 |
matrix: |
| 43 |
go-version: [1.23.x, 1.25.x] |
| 44 |
platform: [ubuntu-latest, macos-latest] |
| 45 |
runs-on: ${{ matrix.platform }} |
| 46 |
steps: |
| 47 |
- name: Install Go |
| 48 |
uses: actions/setup-go@v3 |
| 49 |
with: |
| 50 |
go-version: ${{ matrix.go-version }} |
| 51 |
- name: Checkout code |
| 52 |
uses: actions/checkout@v2 |
| 53 |
- name: Verify go directive |
| 54 |
run: | |
| 55 |
make verify-go-directive |
| 56 |
lint: |
| 57 |
runs-on: ubuntu-latest |
| 58 |
steps: |
| 59 |
- name: Install Go |
| 60 |
uses: actions/setup-go@v6 |
| 61 |
with: |
| 62 |
go-version: v1.23 |
| 63 |
- name: Checkout code |
| 64 |
uses: actions/checkout@v5 |
| 65 |
- name: Lint |
| 66 |
uses: golangci/golangci-lint-action@v6 |
| 67 |
with: |
| 68 |
version: v1.60.1 |
| 69 |
args: --disable-all -v -E govet -E misspell -E gofmt -E ineffassign -E revive |
| 70 |
apidiff: |
| 71 |
runs-on: ubuntu-latest |
| 72 |
if: github.base_ref |
| 73 |
steps: |
| 74 |
- name: Install Go |
| 75 |
uses: actions/setup-go@v3 |
| 76 |
with: |
| 77 |
go-version: 1.23.x |
| 78 |
- name: Add GOBIN to PATH |
| 79 |
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH |
| 80 |
- name: Install dependencies |
| 81 |
run: go install golang.org/x/exp/cmd/apidiff@latest |
| 82 |
- name: Checkout old code |
| 83 |
uses: actions/checkout@v2 |
| 84 |
with: |
| 85 |
ref: ${{ github.base_ref }} |
| 86 |
path: "old" |
| 87 |
- name: Checkout new code |
| 88 |
uses: actions/checkout@v2 |
| 89 |
with: |
| 90 |
path: "new" |
| 91 |
- name: APIDiff |
| 92 |
run: ./hack/verify-apidiff.sh -d ../old |
| 93 |
working-directory: "new" |