-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (104 loc) · 3.82 KB
/
Copy pathci.yml
File metadata and controls
131 lines (104 loc) · 3.82 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
on:
push:
tags-ignore:
- 'v*'
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
DOTNET_NOLOGO: true
CARGO_TERM_COLOR: always
jobs:
rust-lint:
name: Rust Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust
shell: bash
run: |
rustup toolchain install stable --profile minimal
rustup component add rustfmt clippy --toolchain stable
rustup default stable
- name: Check formatting
run: cargo fmt --manifest-path rust/Cargo.toml --all --check
- name: Run clippy
run: cargo clippy -q --manifest-path rust/Cargo.toml --workspace --tests -- -D warnings
rust-build:
name: Rust Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust on Linux
if: runner.os != 'Windows'
shell: bash
run: |
rustup toolchain install stable --profile minimal
rustup default stable
- name: Setup Rust on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
rustup toolchain install stable --profile minimal
rustup default stable
- name: Test pinget-core
run: cargo test -p pinget-core --manifest-path rust/Cargo.toml
- name: Test pinget-cli
run: cargo test -p pinget-cli --manifest-path rust/Cargo.toml
- name: Build pinget-cli
run: cargo build -p pinget-cli --manifest-path rust/Cargo.toml
dotnet:
name: Dotnet Build
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Setup Rust
shell: pwsh
run: |
rustup toolchain install stable --profile minimal --target x86_64-pc-windows-msvc --target aarch64-pc-windows-msvc
rustup default stable
- name: Install Pester
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Pester -Scope CurrentUser -Force -SkipPublisherCheck
- name: Restore solution
run: dotnet restore dotnet/Devolutions.Pinget.slnx
- name: Build solution
run: dotnet build dotnet/Devolutions.Pinget.slnx -c Release --no-restore
- name: Run core tests
run: dotnet test dotnet/src/Devolutions.Pinget.Core.Tests/Devolutions.Pinget.Core.Tests.csproj -c Release --no-build
- name: Build native COM DLLs
shell: pwsh
env:
RUSTFLAGS: -C target-feature=+crt-static
run: |
cargo build -p pinget-com --manifest-path rust/Cargo.toml --release --target x86_64-pc-windows-msvc
cargo build -p pinget-com --manifest-path rust/Cargo.toml --release --target aarch64-pc-windows-msvc
- name: Run PowerShell tests
shell: pwsh
run: pwsh -NoLogo -NoProfile -File (Resolve-Path 'dotnet/tests/RunTests.ps1')
- name: Validate NuGet packing
shell: pwsh
run: |
New-Item -Path artifacts/ci-nuget -ItemType Directory -Force | Out-Null
dotnet pack dotnet/src/Devolutions.Pinget.Core/Devolutions.Pinget.Core.csproj -c Release --no-build -o artifacts/ci-nuget
dotnet pack dotnet/src/Devolutions.Pinget.PowerShell.Engine/Devolutions.Pinget.PowerShell.Engine.csproj -c Release --no-build -o artifacts/ci-nuget
- name: Validate PowerShell module packaging
shell: pwsh
run: pwsh -NoLogo -NoProfile -File (Resolve-Path 'scripts/Build-PowerShellModule.ps1') -NoBuild -OutputRoot artifacts/ci-powershell -Clean