fix: fix goreleaser run #358
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: Go | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
test: | |
name: Test & Lint | |
runs-on: ${{ matrix.os }} | |
env: | |
GOARCH: ${{ matrix.arch }} | |
CGO_ENABLED: ${{ matrix.cgo }} | |
CPATH: ${{ matrix.cpath }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
arch: amd64 | |
cgo: 1 | |
cpath: C:\Program Files (x86)\WinFsp\inc\fuse | |
- os: ubuntu-latest | |
arch: amd64 | |
cgo: 1 | |
- os: macos-latest | |
arch: amd64 | |
cgo: 1 | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install go | |
uses: actions/setup-go@v2 | |
with: | |
stable: true | |
go-version: '1.22' | |
- name: Install winfsp (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
$releases = Invoke-WebRequest https://api.github.com/repos/winfsp/winfsp/releases | ` | |
ConvertFrom-Json | |
$asseturi = $releases[0].assets.browser_download_url | ` | |
Where-Object { $_ -match "winfsp-.*\.msi" } | |
Invoke-WebRequest -Uri $asseturi -Out winfsp.msi | |
Start-Process -NoNewWindow -Wait msiexec "/i winfsp.msi /qn INSTALLLEVEL=1000" | |
shell: powershell | |
- name: Install FUSE (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get -qq install libfuse-dev | |
sudo apt-get -qq install libacl1-dev | |
- name: Install FUSE (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
brew update | |
brew install --cask macfuse | |
- name: Set git to use LF | |
run: git config --global core.autocrlf false | |
- name: Cache Go modules | |
uses: actions/cache@v1 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.OS }}-build-${{ env.cache-name }}- | |
${{ runner.OS }}-build- | |
${{ runner.OS }}- | |
# to avoid no matching files found for go:embed all:frontend/dist in main.go | |
- run: | | |
mkdir frontend/dist | |
touch frontend/dist/index.html | |
- name: Lint | |
if: matrix.os == 'macos-latest' | |
run: | |
make lint | |
- name: Test | |
run: make test | |
# - name: Race | |
# if: matrix.os != 'windows-latest' | |
# run: make test-race | |