-
Notifications
You must be signed in to change notification settings - Fork 35
142 lines (120 loc) · 3.92 KB
/
Copy pathci-examples.yml
File metadata and controls
142 lines (120 loc) · 3.92 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
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: ci-examples
# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- main
- stable/*
# Or when a pull request event occurs for a pull request against one of the
# matched branches.
pull_request:
branches:
- main
- stable/*
# Cancel in-progress jobs on same branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CMAKE_POLICY_VERSION_MINIMUM: 3.5
jobs:
lint-test-runtime-sdk:
name: lint-test-runtime-sdk
runs-on: ubuntu-latest
strategy:
matrix:
example:
- runtime-sdk/minimal-runtime
- runtime-sdk/rofl-oracle-sgx
- runtime-sdk/rofl-oracle-tdx-raw
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
run: rustup show
# Generate Cargo.lock needed for linting.
- name: Generate Cargo.lock
working-directory: examples/${{ matrix.example }}
run: cargo generate-lockfile
- name: Lint ${{ matrix.example }}
uses: ./.github/actions/lint-rust
with:
token: ${{ secrets.GITHUB_TOKEN }}
manifest_path: examples/${{ matrix.example }}/Cargo.toml
- name: Build and test ${{ matrix.example }}
working-directory: examples/${{ matrix.example }}
run: cargo test
build-runtime-sdk-rofl:
name: build-runtime-sdk-rofl
runs-on: ubuntu-latest
strategy:
matrix:
example:
- runtime-sdk/rofl-oracle-sgx
- runtime-sdk/rofl-oracle-tdx-raw
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Oasis CLI
uses: oasisprotocol/setup-cli-action@0.0.2
- name: Build ${{ matrix.example }}
working-directory: examples/${{ matrix.example }}
run: oasis rofl build --deployment testnet
lint-test-contract-sdk:
name: lint-test-contract-sdk
runs-on: ubuntu-latest
strategy:
matrix:
example:
- contract-sdk/hello-world
- contract-sdk/c10l-hello-world
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
run: rustup show
# Generate Cargo.lock needed for linting.
- name: Generate Cargo.lock
working-directory: examples/${{ matrix.example }}
run: cargo generate-lockfile
- name: Lint ${{ matrix.example }}
uses: ./.github/actions/lint-rust
with:
token: ${{ secrets.GITHUB_TOKEN }}
manifest_path: examples/${{ matrix.example }}/Cargo.toml
- name: Build ${{ matrix.example }} for wasm32
working-directory: examples/${{ matrix.example }}
run: cargo build --target wasm32-unknown-unknown --release
- name: Test ${{ matrix.example }}
working-directory: examples/${{ matrix.example }}
run: cargo test
lint-test-client-sdk-go:
name: lint-test-client-sdk-go
runs-on: ubuntu-latest
strategy:
matrix:
example:
- client-sdk/go/minimal-runtime-client
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26.x"
# Generate go.sum needed for linting.
- name: Generate go.sum
working-directory: examples/${{ matrix.example }}
run: go get
# NOTE: "file exists" tar errors can be safely ignored, because go is already installed.
- name: Lint ${{ matrix.example }}
uses: golangci/golangci-lint-action@v8
with:
# NOTE: The version must be specified without the patch version.
version: v2.11
working-directory: examples/${{ matrix.example }}
- name: Build ${{ matrix.example }}
working-directory: examples/${{ matrix.example }}
run: go build