forked from oasisprotocol/oasis-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (96 loc) · 3.26 KB
/
ci-examples.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# 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
jobs:
lint-test-runtime-sdk:
name: lint-test-runtime-sdk
runs-on: ubuntu-latest
strategy:
matrix:
example: [runtime-sdk/minimal-runtime]
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
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.22.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/[email protected]
with:
# NOTE: The version must be specified without the patch version.
version: v1.54.2
working-directory: examples/${{ matrix.example }}
- name: Build ${{ matrix.example }}
working-directory: examples/${{ matrix.example }}
run: go build