| 1 |
name: ci |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
pull_request: |
| 8 |
branches: |
| 9 |
- '*' |
| 10 |
|
| 11 |
jobs: |
| 12 |
gofmt: |
| 13 |
runs-on: ubuntu-latest |
| 14 |
|
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v2 |
| 17 |
- name: Set up Go |
| 18 |
uses: actions/[email protected] |
| 19 |
with: |
| 20 |
go-version: ^1.19 |
| 21 |
id: go |
| 22 |
# Check the codebase has been formatted by `gofmt`. |
| 23 |
# We run two `gofmt` commands for different purposes: |
| 24 |
# 1. `gofmt -d .`: to print diffs in the CI log if any. |
| 25 |
# 2. `gofmt -l`: to test there is a diff in the codebase. This is because |
| 26 |
# `gofmt` exits with exit status 0 even if there is a diff. |
| 27 |
# This is recommended in https://github.com/golang/go/issues/24230) |
| 28 |
- name: Run gofmt |
| 29 |
run: | |
| 30 |
gofmt -d . |
| 31 |
test -z $(gofmt -l .) |
| 32 |
|
| 33 |
linux-tests: |
| 34 |
runs-on: ubuntu-latest |
| 35 |
|
| 36 |
steps: |
| 37 |
- uses: actions/checkout@v2 |
| 38 |
- name: Set up Go |
| 39 |
uses: actions/[email protected] |
| 40 |
with: |
| 41 |
go-version: ^1.19 |
| 42 |
id: go |
| 43 |
- name: Install fuse |
| 44 |
run: sudo apt-get update && sudo apt-get install -y fuse3 libfuse-dev |
| 45 |
- name: Build |
| 46 |
run: go build ./... |
| 47 |
# Disabled running `go test` because running tests hung at random, |
| 48 |
# preventing us from running the tests in CI reliably. |
| 49 |
# (cf. https://github.com/jacobsa/fuse/issues/97) |
| 50 |
|
| 51 |
macos-build: |
| 52 |
runs-on: macos-latest |
| 53 |
|
| 54 |
steps: |
| 55 |
- uses: actions/checkout@v2 |
| 56 |
- name: Set up Go |
| 57 |
uses: actions/[email protected] |
| 58 |
with: |
| 59 |
go-version: ^1.19 |
| 60 |
id: go |
| 61 |
- name: Install macfuse |
| 62 |
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install macfuse |
| 63 |
- name: Build |
| 64 |
run: | |
| 65 |
go build ./... |
| 66 |
go build ./samples/mount_hello/... ./samples/mount_roloopbackfs/... ./samples/mount_sample/... |
| 67 |
# Skip running tests as `go test` hung in macOS. |