-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (80 loc) · 2.31 KB
/
ci.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: ci
on:
push:
pull_request:
branches: main
permissions:
contents: read
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_GENERATE_ASPNET_CERTIFICATE: 0
RestoreLockedMode: true
RepositoryBranch: '${{ github.ref_name }}'
RepositoryCommit: '${{ github.sha }}'
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
Configuration: ['Debug', 'Release']
env:
Configuration: '${{ matrix.configuration }}'
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: true
- name: setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8
- name: restore
run: dotnet restore
- name: build
run: dotnet build --no-restore
- name: test
run: dotnet test --no-restore --no-build
- name: pack
if: ${{ matrix.configuration == 'Release' }}
run: |
dotnet pack src/VbaCompiler/VbaCompiler.csproj --no-build --no-restore -o dist
dotnet pack src/vbamc/vbamc.csproj --no-build --no-restore -o dist
- name: publish artifact
if: ${{ matrix.configuration == 'Release' }}
uses: actions/upload-artifact@v3
with:
name: 'vbamc_packages_${{ matrix.configuration }}'
path: '${{ github.workspace }}/dist'
benchmark:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-22.04', 'windows-2022']
env:
Configuration: 'Release'
PROJECT: 'tests/VbaCompiler.Benchmark/VbaCompiler.Benchmark.csproj'
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: true
- name: setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8
- name: restore
run: dotnet restore
- name: build
run: dotnet build --no-restore -c Release tests/VbaCompiler.Benchmark/VbaCompiler.Benchmark.csproj
- name: benchmark
shell: bash
run: |
dotnet run -c Release --project tests/VbaCompiler.Benchmark/VbaCompiler.Benchmark.csproj -- -e github --artifacts
{
echo "## VBA Compiler Benchmark"
echo ""
echo "Runner: \`${{ matrix.os }}\`"
echo ""
cat "BenchmarkDotNet.Artifacts/results/CompileMacroBenchmark-report-github.md"
} >> $GITHUB_STEP_SUMMARY