-
Notifications
You must be signed in to change notification settings - Fork 47
93 lines (79 loc) · 2.81 KB
/
csharp-securememory-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
name: '[C#] SecureMemory CI'
on:
workflow_dispatch:
push:
paths:
- 'csharp/SecureMemory/**'
- '.github/workflows/csharp-securememory-*'
branches-ignore:
- 'release-*'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-csharp-sm-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
artifact: ${{ steps.upload-artifact.outputs.artifact_id }}
container:
image: mcr.microsoft.com/dotnet/sdk:6.0
options: --ulimit core=-1 --ulimit memlock=-1:-1
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Add workspace to safe.directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Cache dotnet packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('csharp/**/*.csproj') }}-v2
- name: Build
run: |
cd csharp/SecureMemory
./scripts/clean.sh
./scripts/build.sh
- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: csharp-secure-memory
path: |
csharp/SecureMemory/SecureMemory/bin/**
csharp/SecureMemory/SecureMemory/obj/**
csharp/SecureMemory/PlatformNative/bin/**
csharp/SecureMemory/PlatformNative/obj/**
csharp/SecureMemory/SecureMemory.Tests/bin/**
csharp/SecureMemory/SecureMemory.Tests/obj/**
test:
name: Run Unit Tests
runs-on: ubuntu-latest
needs: build
container:
image: mcr.microsoft.com/dotnet/sdk:6.0
options: --ulimit core=-1 --ulimit memlock=-1:-1
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Cache dotnet packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('csharp/**/*.csproj') }}-v2
- name: Download artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: csharp-secure-memory
path: ${{ github.workspace }}/csharp/SecureMemory
- name: Run unit tests
run: |
cd csharp/SecureMemory
./scripts/test.sh
- name: Unit test summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.3.0
with:
paths: 'csharp/SecureMemory/SecureMemory.Tests/test-result.xml'
if: always()