-
Notifications
You must be signed in to change notification settings - Fork 33
99 lines (83 loc) · 2.96 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
name: Continuous Integration
on:
pull_request:
push:
branches:
- main
- "releases/*"
jobs:
build-lint-test:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-arm]
include:
- os: windows-latest
checkTarget: true
- os: ubuntu-latest
docsTarget: true
- os: ubuntu-arm
runsOn: buildjet-4vcpu-ubuntu-2204-arm
runs-on: ${{ matrix.runsOn || matrix.os }}
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}, os: ${{ matrix.os }}"
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src/Temporalio/Bridge
- name: Setup .NET
uses: actions/setup-dotnet@v3
- name: Install protoc (x64)
# Does not work on arm
if: ${{ matrix.os != 'ubuntu-arm' }}
uses: arduino/setup-protoc@v1
with:
# TODO(cretz): Upgrade when https://github.com/arduino/setup-protoc/issues/33 fixed
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install protoc (Linux ARM)
if: ${{ matrix.os == 'ubuntu-arm' }}
run: |
sudo apt update -y
sudo apt install -y protobuf-compiler
- name: Build
# We intentionally just build debug mode in this CI
run: dotnet build
- name: Regen + format and confirm unchanged
if: ${{ matrix.checkTarget }}
run: |
dotnet tool install --global csharpier
dotnet tool install --global ClangSharpPInvokeGenerator
ClangSharpPInvokeGenerator @src/Temporalio/Bridge/GenerateInterop.rsp
dotnet run --project src/Temporalio.Api.Generator
dotnet format style && dotnet format analyzers && dotnet csharpier .
git config --global core.safecrlf false
git diff --exit-code
- name: Test
run: dotnet test --logger "console;verbosity=detailed" --blame-crash
- name: Upload test failure
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: test-fail-${{ matrix.os }}
path: tests/Temporalio.Tests/TestResults
- name: Build docs
if: ${{ matrix.docsTarget }}
uses: nikeee/docfx-action@v1.0.0
with:
args: src/Temporalio.ApiDoc/docfx.json
- name: Deploy docs
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/obj/_site --token ${{ secrets.VERCEL_TOKEN }} --prod --yes