CI #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |