-
Notifications
You must be signed in to change notification settings - Fork 52
71 lines (70 loc) · 2.18 KB
/
main.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
name: CI
on:
push:
branches: [main, 'release-*']
tags-ignore: [dev]
pull_request:
branches: [main, 'release-*']
schedule:
- cron: '0 0 * * *' # run at 00:00 UTC
jobs:
build:
name: Test .NET embedding of Wasmtime
runs-on: ${{ matrix.os }}
env:
DevBuild: 'false'
strategy:
fail-fast: false
matrix:
build: [linux-debug, linux-release, macos-debug, macos-release, windows-debug, windows-release]
include:
- build: linux-debug
os: ubuntu-latest
config: debug
- build: linux-release
os: ubuntu-latest
config: release
- build: macos-debug
os: macos-latest
config: debug
- build: macos-release
os: macos-latest
config: release
- build: windows-debug
os: windows-2019
config: debug
- build: windows-release
os: windows-2019
config: release
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
# workaround for actions/setup-dotnet#155
- name: Clear package cache
run: dotnet clean Wasmtime.sln && dotnet nuget locals all --clear
- name: Enable development builds for the main branch
if: github.ref == 'refs/heads/main' || github.base_ref == 'main'
shell: bash
run: |
echo "DevBuild=true" >> $GITHUB_ENV
- name: Restore packages
run: dotnet restore Wasmtime.sln
- name: Build
run: dotnet build Wasmtime.sln -c ${{ matrix.config }} --no-restore
- name: Test
run: dotnet test Wasmtime.sln -c ${{ matrix.config }}
- name: Benchmark
if: matrix.config == 'release'
run: dotnet run -c ${{ matrix.config }} --project benchmarks/simple/simple.csproj
- name: Run examples
shell: bash
env:
EXAMPLES: externref funcref global hello memory table consumefuel
run: |
for e in $EXAMPLES; do cd examples/$e && dotnet run -c ${{ matrix.config }} && cd ../..; done
- name: Create package
run: |
cd src
dotnet pack -c ${{ matrix.config }} /p:Packing=true