-
Notifications
You must be signed in to change notification settings - Fork 6
126 lines (126 loc) · 3.57 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [ master, develop, release/* ]
pull_request:
branches: [ master, release/* ]
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings -C target-feature=-a
RUST_BACKTRACE: full
RUST_TOOLCHAIN: 1.68.2
jobs:
#
# Contracts
#
format-contracts:
name: Checks / Format (contracts)
runs-on: ubuntu-latest
container:
image: yangby0cryptape/ibc-ckb-contracts-build-env:0.2.0-alpha.0
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Run the Checker
run: make format-all-contracts
lint-contracts:
name: Checks / Lint (contracts)
runs-on: ubuntu-latest
container:
image: yangby0cryptape/ibc-ckb-contracts-build-env:0.2.0-alpha.0
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Run the Checker
run: make lint-all-contracts
build-contracts:
name: Build / Debug (contracts)
needs: [ format-contracts, lint-contracts ]
runs-on: ubuntu-latest
container:
image: yangby0cryptape/ibc-ckb-contracts-build-env:0.2.0-alpha.0
env:
CARGO_BUILD_ARGS: --features debugging
CARGO_PROFILE_RELEASE_DEBUG: true
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Build Contracts in Debug Mode
run: make all-contracts
- name: Upload Contracts
uses: actions/upload-artifact@v3
with:
name: all-contracts-in-debug-mode
path: build
#
# Test Utils
#
format-test-utils:
name: Checks / Format (test-utils)
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Set Rust Toolchain
run: |
rustup toolchain install --profile minimal ${{ env.RUST_TOOLCHAIN }}
rustup default ${{ env.RUST_TOOLCHAIN }}
rustup component add rustfmt
- name: Run the Checker
run: make format-test-utils
lint-test-utils:
name: Checks / Lint (test-utils)
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Set Rust Toolchain
run: |
rustup toolchain install --profile minimal ${{ env.RUST_TOOLCHAIN }}
rustup default ${{ env.RUST_TOOLCHAIN }}
rustup component add clippy
- name: Run the Checker
run: make lint-test-utils
#
# Run Tests
#
run-tests:
name: Tests / Build & Test
needs: [ build-contracts, format-test-utils, lint-test-utils ]
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Set Rust Toolchain
run: |
rustup toolchain install --profile minimal ${{ env.RUST_TOOLCHAIN }}
rustup default ${{ env.RUST_TOOLCHAIN }}
- name: Download Contracts
uses: actions/download-artifact@v3
with:
name: all-contracts-in-debug-mode
path: build
- name: Run the Tests
run: make test
#
# Build Contracts in Release Mode
#
release-contracts:
name: Build / Release (contracts)
needs: [ run-tests ]
runs-on: ubuntu-latest
container:
image: yangby0cryptape/ibc-ckb-contracts-build-env:0.2.0-alpha.0
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
- name: Build Contracts in Release Mode
run: make all-contracts
- name: Upload Contracts
uses: actions/upload-artifact@v3
with:
name: all-contracts
path: build