workflows: add MacOS CLI build and test configurations

Unfortunately, the default MacOS runner produces amd64 binaries, therefore we
need to set GOARCH appropriately. At the same time, docker image will be
linux/arm64, so we can build it as well.
This commit is contained in:
Roman Khimov 2022-07-15 13:56:08 +03:00
parent 740cf500fd
commit 16083459b8
2 changed files with 14 additions and 4 deletions

View file

@ -24,7 +24,11 @@ jobs:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-20.04, windows-2022]
os: [ubuntu-20.04, windows-2022, macos-12]
arch: [amd64, arm64]
exclude:
- os: windows-2022
arch: 'arm64'
steps:
- uses: actions/checkout@v2
@ -49,11 +53,13 @@ jobs:
- name: Build CLI
run: make build
env:
GOARCH: ${{ matrix.arch }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: neo-go-binaries
name: neo-go-${{ matrix.os }}-${{ matrix.arch }}
path: ./bin/neo-go*
if-no-files-found: error

View file

@ -82,14 +82,18 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2022]
os: [ubuntu-20.04, windows-2022, macos-12]
go_versions: [ '1.16', '1.17', '1.18' ]
exclude:
# Only latest Go version for Windows.
# Only latest Go version for Windows and MacOS.
- os: windows-2022
go_versions: '1.16'
- os: windows-2022
go_versions: '1.17'
- os: macos-12
go_versions: '1.16'
- os: macos-12
go_versions: '1.17'
# Exclude latest Go version for Ubuntu as Coverage uses it.
- os: ubuntu-20.04
go_versions: '1.18'