Skip to content

Commit

Permalink
ci: merge tests into one job using a matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
aykevl committed Sep 23, 2023
1 parent bba3c70 commit e9707cc
Showing 1 changed file with 20 additions and 89 deletions.
109 changes: 20 additions & 89 deletions .github/workflows/test.yml
Expand Up @@ -6,113 +6,44 @@ name: Test
on: [push, pull_request]

jobs:
test-macos-llvm-14:
test-macos:
runs-on: macos-latest
strategy:
matrix:
llvm: [14, 15, 16, 17]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update Homebrew
if: matrix.llvm == 17 # needed as long as LLVM 17 is still fresh
run: brew update
- name: Install LLVM
run: |
brew update
brew install llvm@14
- name: Test LLVM 14
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@${{ matrix.llvm }}
- name: Test LLVM ${{ matrix.llvm }}
run:
go test -v -tags=llvm14
test-macos-llvm-15:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install LLVM
run: |
brew update
brew install llvm@15
- name: Test LLVM 15
run:
go test -v -tags=llvm15
test-macos-llvm-16:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install LLVM
run: |
brew update
brew install llvm@16
- name: Test LLVM 16
run:
go test -v -tags=llvm16
go test -v -tags=llvm${{ matrix.llvm }}
- name: Test default LLVM
if: matrix.llvm == 16
run:
go test -v
test-macos-llvm-17:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install LLVM
run: |
brew update
brew install llvm@17
- name: Test LLVM 17
run:
go test -v -tags=llvm17
test-linux-llvm-14:
test-linux:
runs-on: ubuntu-20.04
strategy:
matrix:
llvm: [14, 15, 16, 17]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install LLVM
run: |
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main' | sudo tee /etc/apt/sources.list.d/llvm.list
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.llvm }} main' | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install --no-install-recommends llvm-14-dev
- name: Test LLVM 14
sudo apt-get install --no-install-recommends llvm-${{ matrix.llvm }}-dev
- name: Test LLVM ${{ matrix.llvm }}
run:
go test -v -tags=llvm14
test-linux-llvm-15:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install LLVM
run: |
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main' | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install --no-install-recommends llvm-15-dev
- name: Test LLVM 15
run:
go test -v -tags=llvm15
test-linux-llvm-16:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install LLVM
run: |
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main' | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install --no-install-recommends llvm-16-dev
- name: Test LLVM 16
run:
go test -v -tags=llvm16
go test -v -tags=llvm${{ matrix.llvm }}
- name: Test default LLVM
if: matrix.llvm == 16
run:
go test -v
test-linux-llvm-17:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install LLVM
run: |
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main' | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install --no-install-recommends llvm-17-dev
- name: Test LLVM 17
run:
go test -v -tags=llvm17

0 comments on commit e9707cc

Please sign in to comment.