-
Notifications
You must be signed in to change notification settings - Fork 57
181 lines (161 loc) · 7.6 KB
/
ci.yml
File metadata and controls
181 lines (161 loc) · 7.6 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Continuous Integration
on:
pull_request:
push:
branches:
- main
- "releases/*"
permissions:
actions: read
contents: read
jobs:
build-lint-test:
env:
RestoreLockedMode: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest, windows-arm]
include:
- os: windows-latest
checkTarget: true
- os: ubuntu-latest
docsTarget: true
cloudTestTarget: true
- os: ubuntu-arm
runsOn: ubuntu-24.04-arm64-2-core
- os: macos-intel
runsOn: macos-15-intel
- os: macos-arm
runsOn: macos-14
- os: windows-arm
runsOn: windows-11-arm
runs-on: ${{ matrix.runsOn || matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: src/Temporalio/Bridge
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5
with:
# Specific .NET version required because GitHub macos ARM image has
# bad pre-installed .NET version
dotnet-version: '10.x'
- name: Install protoc
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
with:
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed
version: "23.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Regen confirm unchanged
if: ${{ matrix.checkTarget }}
run: |
$ErrorActionPreference = 'Stop'
dotnet tool install --global --version '[20.1.2.1]' ClangSharpPInvokeGenerator
ClangSharpPInvokeGenerator @src/Temporalio/Bridge/GenerateInterop.rsp
dotnet run --project src/Temporalio.Api.Generator
git add .
git config --global core.safecrlf false
git diff --cached > generator.diff
git diff --cached --exit-code
- name: Upload generator diff
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: always()
with:
name: generator-diff
path: generator.diff
if-no-files-found: ignore
overwrite: true
- name: Check format
if: ${{ matrix.checkTarget }}
run: dotnet format --verify-no-changes
- name: Build
run: dotnet build
- name: Test
run: |
dotnet test --logger "console;verbosity=detailed" --logger "trx;LogFilePrefix=test-results" --results-directory tests/Temporalio.Tests/TestResults --blame-crash -v n --blame-hang-timeout 10m
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: test-results-${{ matrix.os }}
path: tests/Temporalio.Tests/TestResults/**/*.trx
if-no-files-found: warn
overwrite: true
- name: Confirm bench works
run: dotnet run --project tests/Temporalio.SimpleBench/Temporalio.SimpleBench.csproj -- --workflow-count 5 --max-cached-workflows 100 --max-concurrent 100
- name: Test cloud (mTLS)
# Only supported in non-fork, non-Dependabot runs since secrets are not available in those contexts.
if: ${{ matrix.cloudTestTarget && github.actor != 'dependabot[bot]' && (github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-dotnet') }}
env:
TEMPORAL_TEST_CLIENT_TARGET_HOST: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
TEMPORAL_TEST_CLIENT_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
TEMPORAL_TEST_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
TEMPORAL_TEST_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
run: dotnet run --project tests/Temporalio.Tests -- -verbose -method "*.ExecuteWorkflowAsync_Simple_Succeeds"
- name: Test cloud (API key)
# Only supported in non-fork, non-Dependabot runs since secrets are not available in those contexts.
# Uses API key auth to test auto-TLS feature (TLS auto-enabled when API key provided).
if: ${{ matrix.cloudTestTarget && github.actor != 'dependabot[bot]' && (github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-dotnet') }}
env:
TEMPORAL_TEST_CLIENT_TARGET_HOST: us-east-1.aws.api.temporal.io:7233
TEMPORAL_TEST_CLIENT_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
run: dotnet run --project tests/Temporalio.Tests -- -verbose -method "*.ExecuteWorkflowAsync_Simple_Succeeds"
- name: Test cloud operations client
# Only supported in non-fork, non-Dependabot runs since secrets are not available in those contexts.
if: ${{ matrix.cloudTestTarget && github.actor != 'dependabot[bot]' && (github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-dotnet') }}
env:
TEMPORAL_CLIENT_CLOUD_NAMESPACE: sdk-ci.a2dd6
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
TEMPORAL_CLIENT_CLOUD_API_VERSION: 2024-05-13-00
run: dotnet run --project tests/Temporalio.Tests -- -verbose -method "*.TemporalCloudOperationsClientTests.*"
- name: Upload native symbols
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: ${{ failure() }}
with:
name: symbols-native-${{ matrix.os }}
if-no-files-found: error
overwrite: true
path: |
src/Temporalio/Bridge/sdk-core/target/debug/*.dll
src/Temporalio/Bridge/sdk-core/target/debug/*.dylib
src/Temporalio/Bridge/sdk-core/target/debug/*.pdb
src/Temporalio/Bridge/sdk-core/target/debug/*.so
- name: Upload managed symbols
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: ${{ failure() }}
with:
name: symbols-managed-${{ matrix.os }}
if-no-files-found: error
overwrite: true
path: |
src/**/bin/Debug/**/*.dll
src/**/bin/Debug/**/*.pdb
- name: Build docs
if: ${{ matrix.docsTarget }}
run: |
dotnet tool update -g docfx
docfx src/Temporalio.ApiDoc/docfx.json --warningsAsErrors
- name: Deploy docs
# Only deploy on main merge, not in PRs
if: ${{ github.ref == 'refs/heads/main' && matrix.docsTarget }}
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
run: npx vercel deploy src/Temporalio.ApiDoc/_site --token ${{ secrets.VERCEL_TOKEN }} --prod --yes
# Runs the sdk features repo tests with this repo's current SDK code
features-tests:
uses: temporalio/features/.github/workflows/dotnet.yaml@main
with:
dotnet-repo-path: ${{github.event.pull_request.head.repo.full_name}}
version: ${{github.event.pull_request.head.ref}}
version-is-repo-ref: true
features-repo-ref: standalone-activities-dotnet