-
Notifications
You must be signed in to change notification settings - Fork 161
91 lines (77 loc) · 2.72 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Build and Test
on:
push:
branches:
- master
- staging
- trying
schedule:
- cron: '0 2 * * *' # To test `wasmer-nightly` with `libwasmer_archive_name`.
jobs:
test:
name: Build and Test
strategy:
matrix:
go: [1.14, 1.15]
target:
- id: 'linux-amd64'
os: 'ubuntu-18.04'
#- id: 'linux-aarch64'
# os: ['self-hosted', 'linux', 'ARM64']
- id: 'darwin-amd64'
os: 'macos-latest'
- id: 'linux-amd64'
os: 'ubuntu-18.04'
libwasmer_archive_name: 'wasmer-linux-amd64.tar.gz'
fail-fast: true
runs-on: ${{ matrix.target.os }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: false
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Set up just
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
cargo install just
- name: Run all the tests (default)
if: ${{ !matrix.target.libwasmer_archive_name }}
shell: bash
run: |
just test
- name: Run all the tests (with custom Wasmer runtime)
if: matrix.target.libwasmer_archive_name
continue-on-error: true
shell: bash
run: |
libwasmer_url=$(curl -s https://api.github.com/repos/wasmerio/wasmer-nightly/releases/latest | jq --raw-output '.assets[] | select(.name == "${{ matrix.target.libwasmer_archive_name }}") | .browser_download_url')
mkdir -p libwasmer
curl -L $libwasmer_url > release.tar.gz
tar xzvf release.tar.gz -C libwasmer
export CGO_CFLAGS="-I$(pwd)/libwasmer/include/"
export CGO_LDFLAGS="-Wl,-rpath,$(pwd)/libwasmer/lib/ -L$(pwd)/libwasmer/lib/ -lwasmer"
just test -tags custom_wasmer_runtime
- name: Run all the examples
shell: bash
run: |
just examples
# Skipped for now because of Github banning the API request from actions.
# You can find more info in this PR: https://github.com/wasmerio/wasmer-go/pull/118#issuecomment-588487544
# - name: Test bazel build
# shell: bash
# run: |
# export GOOS=$(go env GOHOSTOS)
# curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.2.1/bazelisk-${GOOS}-amd64"
# mkdir -p "${GITHUB_WORKSPACE}/bin/"
# mv "bazelisk-${GOOS}-amd64" "${GITHUB_WORKSPACE}/bin/bazel"
# chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
# "${GITHUB_WORKSPACE}/bin/bazel" build //...