Code review #76
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: compile and test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Initialize submodules | |
run: | | |
git submodule init | |
git submodule update | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: wasm32-wasi | |
- name: Compile Rust tasks | |
run: | | |
cargo build --release --target wasm32-wasi --manifest-path templates/content/RustWasmTaskTemplate/rust_template/Cargo.toml | |
cargo build --release --target wasm32-wasi --manifest-path examples/rust_mergedirectories/Cargo.toml | |
cargo build --release --target wasm32-wasi --manifest-path examples/rust_concat2files/Cargo.toml | |
- name: install standalone wasmtime | |
run: | | |
curl https://wasmtime.dev/install.sh -sSf | bash | |
echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH | |
export PATH=$HOME/.wasmtime/bin:$PATH | |
wasmtime --version | |
- name: Get global-packages path | |
id: get-packages-path | |
run: | | |
PACKAGES_PATH=$(dotnet nuget locals global-packages -l | cut -d ' ' -f 2) | |
echo "packages_path=$PACKAGES_PATH" >> $GITHUB_OUTPUT | |
- name: Build | |
run: dotnet build src/ -c Release | |
- name: Package | |
run: dotnet pack src/ -o ${{ steps.get-packages-path.outputs.packages_path }} | |
- name: Add local NuGet source | |
run: dotnet nuget add source ${{ steps.get-packages-path.outputs.packages_path }} --name local | |
- name: Examples | |
run: dotnet build examples | |
- name: build MSBuild for unit test .dll | |
run: ./msbuild/build.sh | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Test | |
run: dotnet test |