forked from oasisprotocol/oasis-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (141 loc) · 4.41 KB
/
ci-lint.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
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
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: ci-lint
# 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-rust:
name: lint-rust
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
run: rustup show
- name: Lint Rust code
uses: ./.github/actions/lint-rust
with:
features: debug-logging,debug-mock-sgx,test,unsafe-allow-debug
token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint Rust code (TDX)
uses: ./.github/actions/lint-rust
with:
features: tdx
token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint Hello contract code
uses: ./.github/actions/lint-rust
with:
token: ${{ secrets.GITHUB_TOKEN }}
manifest_path: tests/contracts/hello/Cargo.toml
- name: Lint OAS-20 contract code
uses: ./.github/actions/lint-rust
with:
token: ${{ secrets.GITHUB_TOKEN }}
manifest_path: contract-sdk/specs/token/oas20/Cargo.toml
lint-go-client-sdk:
name: lint-go-client-sdk
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
- name: Lint Go client-sdk
uses: golangci/[email protected]
with:
# NOTE: The version must be specified without the patch version.
version: v1.54.2
working-directory: client-sdk/go
lint-go-tests-e2e:
name: lint-go-tests-e2e
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install libseccomp-dev
run: |
sudo apt-get update
sudo apt-get install libseccomp-dev
- name: Create mock contract files for lint
run: |
touch tests/e2e/contracts/build/hello.wasm
touch tests/e2e/contracts/build/oas20.wasm
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
- name: Lint E2E tests
uses: golangci/[email protected]
with:
# NOTE: The version must be specified without the patch version.
version: v1.56.1
working-directory: tests/e2e
lint-go-reflect:
name: lint-go-reflect
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
- name: Lint reflect-go
uses: golangci/[email protected]
with:
# NOTE: The version must be specified without the patch version.
version: v1.56.1
working-directory: client-sdk/ts-web/core/reflect-go
lint-ts-web:
name: lint-ts-web
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js LTS
uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: npm
cache-dependency-path: 'client-sdk/ts-web/package-lock.json'
- name: Install dependencies and build
working-directory: client-sdk/ts-web
run: npm ci --foreground-scripts
- name: Lint ts-web/core
working-directory: client-sdk/ts-web/core
run: npm run-script lint
- name: Lint ts-web/ext-utils
working-directory: client-sdk/ts-web/ext-utils
run: npm run-script lint
- name: Lint ts-web/signer-ledger
working-directory: client-sdk/ts-web/signer-ledger
run: npm run-script lint
- name: Lint ts-web/rt
working-directory: client-sdk/ts-web/rt
run: npm run-script lint
lint-markdown:
name: lint-markdown
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Lint markdown
uses: nosborn/[email protected]
with:
files: docs