From 16083459b828fa0a1bb234fcf906df4c93875098 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 15 Jul 2022 13:56:08 +0300 Subject: [PATCH] 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. --- .github/workflows/build.yml | 10 ++++++++-- .github/workflows/run_tests.yml | 8 ++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41879e1de..016de7845 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 250d9882a..d08cdc32c 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -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'