From 8cf8953de84bd32d89b898cd1500cec8110fb80a Mon Sep 17 00:00:00 2001 From: Dmitriy Smotrov Date: Fri, 10 Nov 2023 04:06:11 +0400 Subject: [PATCH] Add running tests on macos It needs because I got bug in go-fuse that specific for macos after autoupdate go-fuse version via dependabot, so it should prevent this bugs in future --- .github/workflows/go-releaser.yml | 2 +- .github/workflows/go-test.yml | 20 +++++++++++++++----- .github/workflows/golangci-lint.yml | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go-releaser.yml b/.github/workflows/go-releaser.yml index 6e76e81..dd34b53 100644 --- a/.github/workflows/go-releaser.yml +++ b/.github/workflows/go-releaser.yml @@ -1,4 +1,4 @@ -name: goreleaser +name: Release on: push: diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 3a6c460..fab535a 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -1,4 +1,4 @@ -name: Go package +name: Go tests on: push: @@ -7,15 +7,16 @@ on: branches: - master - main - + pull_request: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: go: [ '1.21', 'stable' ] - name: Go ${{ matrix.go }} + os: [ ubuntu-latest, macos-13 ] + name: Go ${{ matrix.go }} ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -26,7 +27,16 @@ jobs: - name: Install dependencies run: | - sudo apt install fuse + if [ "$RUNNER_OS" = "Linux" ] + then + sudo apt-get update + sudo apt-get install -y fuse + fi + if [ "$RUNNER_OS" = "macOS" ] + then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + brew install --cask macfuse + fi - name: Build run: go build -v ./... diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 75a2c79..db50fed 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,4 +1,4 @@ -name: golangci-lint +name: Lint on: push: tags: