Repository navigation
141 lines (130 loc) · 4.49 KB
/
Copy pathcsharp-testing.yml
File metadata and controls
141 lines (130 loc) · 4.49 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
132
133
134
135
136
137
138
139
140
141
name: C# Testing Packages
on:
workflow_call:
inputs:
use-release-tag:
type: boolean
default: false
release-tag:
type: string
default: ""
# Pull requests build and test linux-x64 only. Everything that lands or ships covers all platforms.
all-platforms:
type: boolean
default: true
outputs:
package-version:
value: ${{ jobs.prepare.outputs.package-version }}
source-sha:
value: ${{ jobs.prepare.outputs.sha }}
permissions:
contents: read
jobs:
prepare:
runs-on: ubuntu-22.04
outputs:
sha: ${{ steps.prepare.outputs.sha }}
package-version: ${{ steps.prepare.outputs.package-version }}
platforms: ${{ steps.prepare.outputs.platforms }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: ${{ inputs.use-release-tag && '0' || '1' }}
- uses: dsherret/rust-toolchain-file@v1
- id: prepare
env:
RELEASE_TAG: ${{ inputs.release-tag }}
GH_TOKEN: ${{ github.token }}
run: >-
cargo ci other-workflows csharp-testing-packages prepare
--use-release-tag ${{ inputs.use-release-tag }} --all-platforms ${{ inputs.all-platforms }}
csharp_testing_native:
needs: prepare
name: C# testing native bridge (${{ matrix.rid }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare.outputs.platforms) }}
env:
RUST_BACKTRACE: full
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.sha }}
persist-credentials: false
- uses: dsherret/rust-toolchain-file@v1
- uses: Swatinem/rust-cache@v2
with:
key: csharp-testing-${{ matrix.rid }}
# Only CI pushes to master populate the cache, so pull requests don't evict each other's entries
# and release runs never write the cache every branch reads.
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Build, inspect and test native bridge
run: cargo ci other-workflows csharp-testing-packages native --rid ${{ matrix.rid }}
- name: Upload tested native bridge
uses: actions/upload-artifact@v4
with:
name: spacetimedb-testing-native-${{ matrix.rid }}
path: native/
if-no-files-found: error
retention-days: 14
csharp_testing_pack:
needs: [prepare, csharp_testing_native]
name: Assemble C# testing packages
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.sha }}
persist-credentials: false
- uses: dsherret/rust-toolchain-file@v1
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- uses: actions/download-artifact@v4
with:
pattern: spacetimedb-testing-native-*
merge-multiple: true
path: native
- name: Pack and check complete package set
run: >-
cargo ci other-workflows csharp-testing-packages pack
--version ${{ needs.prepare.outputs.package-version }} --all-platforms ${{ inputs.all-platforms }}
- uses: actions/upload-artifact@v4
with:
name: spacetimedb-testing-packages
path: feed/*.nupkg
if-no-files-found: error
retention-days: 14
csharp_testing_packages:
needs: [prepare, csharp_testing_pack]
name: C# testing package acceptance (${{ matrix.rid }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare.outputs.platforms) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.sha }}
persist-credentials: false
- uses: dsherret/rust-toolchain-file@v1
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- uses: actions/download-artifact@v4
with:
name: spacetimedb-testing-packages
path: feed
- name: Check C# testing NuGet packages
run: >-
cargo ci other-workflows csharp-testing-packages accept
--version ${{ needs.prepare.outputs.package-version }} --rid ${{ matrix.rid }}