Skip to content

Commit

Permalink
Add GitHub Actions testing
Browse files Browse the repository at this point in the history
  • Loading branch information
aykevl committed Dec 29, 2021
1 parent 9a6a1e4 commit df8bd72
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Test whether we can link to LLVM installed from apt.llvm.org or Homebrew.

name: Test

on: push

jobs:
test-macos-llvm:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install LLVM
run: |
brew install llvm@11
- name: Test LLVM 11
run:
go test -v -tags=llvm11
- name: Test default LLVM
run:
go test -v
test-linux-llvm-12:
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-12 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-12-dev
- name: Test LLVM 12
run:
go test -v -tags=llvm12
- name: Test default LLVM
run:
go test -v
test-linux-llvm-11:
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-11 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-11-dev
- name: Test LLVM 11
run:
go test -v -tags=llvm11
11 changes: 11 additions & 0 deletions llvm_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package llvm_test

import "tinygo.org/x/go-llvm"

import "testing"

// Dummy test function.
// All it does is test whether we can use LLVM at all.
func TestLLVM(t *testing.T) {
t.Log("LLVM version:", llvm.Version)
}

0 comments on commit df8bd72

Please sign in to comment.