Skip to content

Commit

Permalink
github/workflows: support multiple GOOS
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <[email protected]>
  • Loading branch information
zchee committed Nov 9, 2023
1 parent 01fe80a commit bd6e941
Showing 1 changed file with 55 additions and 6 deletions.
61 changes: 55 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,70 @@ on:
branches:
- "main"
pull_request:
branches:
- "main"

defaults:
run:
shell: bash

env:
LLVM_VERSION: 15
# for Homebrew: https://docs.brew.sh/Manpage
HOMEBREW_BOOTSNAP: 1
HOMEBREW_CACHE: "$HOME/.cache/homebrew"
HOMEBREW_CURL_VERBOSE: 1
HOMEBREW_DEVELOPER: 1
HOMEBREW_DISPLAY_INSTALL_TIMES: 1
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_INSTALL_UPGRADE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_VERBOSE: 1

jobs:
test:
name: test
runs-on: ubuntu-22.04
strategy:
matrix:
os:
- "ubuntu-22.04" # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
- "macos-13" # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
- "macos-13 -arm64" # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
- "windows-2022" # https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
go-version:
- "1.20.x"
- "1.21.x"
fail-fast: false

runs-on:
labels: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Test in Docker
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
check-latest: true

- name: Install latest LLVM
if: matrix.os != 'windows-2022'
run: |
if ! command -v brew > /dev/null 2>&1; then /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; fi
brew install llvm@${LLVM_VERSION}
- name: Cache brewed LLVM
if: matrix.os != 'windows-2022'
uses: actions/cache@v3
with:
key: ${{ matrix.os }}-homebrew
path: $[HOMEBREW_CACHE}

- name: Test
run: |
docker container run -t --mount type=bind,src=$PWD,dst=/go/src/github.com/go-clang/clang-v${LLVM_VERSION} -w /go/src/github.com/go-clang/clang-v${LLVM_VERSION} ghcr.io/go-clang/base:${LLVM_VERSION} make test
docker container run -t \
--mount type=bind,src=$PWD,dst=/go/src/github.com/go-clang/clang-v${LLVM_VERSION} \
--workdir /go/src/github.com/go-clang/clang-v${LLVM_VERSION} \
ghcr.io/go-clang/base:${LLVM_VERSION} \
make test

0 comments on commit bd6e941

Please sign in to comment.