This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
forked from Squirrel/Squirrel.Windows
-
Notifications
You must be signed in to change notification settings - Fork 39
78 lines (63 loc) · 2.12 KB
/
build.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
name: Build Squirrel
on: [ push, pull_request ]
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install Rust
run: rustup update stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Build Rust
working-directory: src/Rust
run: |
cargo build
cargo build --release
- name: Test Rust
working-directory: src/Rust
run: cargo llvm-cov --codecov --output-path ../../test/coverage.rust.json
- name: Build .NET
run: dotnet build -c Release
- name: Test .NET
run: dotnet test -c Release --no-build -l "console;verbosity=detailed"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./test/coverage.rust.json,./test/coverage.opencover.xml
fail_ci_if_error: true
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: packages
path: .\build\Release\*.nupkg
- name: Publish to GitHub Packages
shell: pwsh
run: dotnet nuget push .\build\Release\*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate