-
Notifications
You must be signed in to change notification settings - Fork 7
184 lines (174 loc) · 5.77 KB
/
ci-main.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
on:
pull_request:
branches:
- 'main'
name: continuous-integration-main
env:
RUSTUP_NIGHTLY_VERSION: nightly-2024-02-09
RUST_BACKTRACE: full
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"
jobs:
# build-check:
# name: Check Build
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
#
# - name: Undergo Prerequisite
# uses: ./.github/actions/prerequisite
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Check Build
# run: |
# bash ./scripts/cmd-all build check
#
# cargo-clippy:
# name: Run Clippy and Format Checks
# needs: build-check
# if: needs.build-check.result == 'success'
# strategy:
# max-parallel: 2
# matrix:
# rust: [ stable, nightly ]
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
#
# - name: Run Prerequisite
# if: matrix.rust == 'stable'
# uses: ./.github/actions/prerequisite
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Run Prerequisite (for Nightly)
# if: matrix.rust == 'nightly'
# uses: ./.github/actions/prerequisite-nightly
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# version: ${{ env.RUSTUP_NIGHTLY_VERSION }}
#
# - name: Rustfmt
# if: matrix.rust == 'nightly'
# uses: actions-rs/cargo@v1
# with:
# toolchain: ${{ env.RUSTUP_NIGHTLY_VERSION }}
# command: fmt
# args: --all -- --check
#
# - name: Clippy for Tests and Examples
# if: matrix.rust == 'nightly'
# uses: actions-rs/cargo@v1
# with:
# toolchain: ${{ env.RUSTUP_NIGHTLY_VERSION }}
# command: clippy
# args: --all-features --tests --benches --examples -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references
#
# - name: Clippy -- Libraries and Binaries
# if: matrix.rust == 'stable'
# run: |
# bash ./scripts/cmd-all clippy "clippy --lib --bins" "-- -W clippy::all -A clippy::style -A forgetting_copy_types -A forgetting_references"
#
#
# cargo-test-pallets:
# name: Run Tests for Pallets
# needs: build-check
# if: needs.build-check.result == 'success'
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
#
# - name: Run Prerequisite (for Nightly)
# uses: ./.github/actions/prerequisite-nightly
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# version: ${{ env.RUSTUP_NIGHTLY_VERSION }}
#
# - name: Run Tests for Pallets
# run: |
# bash ./scripts/cmd-pallets test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test"
#
# - name: Run Tests for Other Libraries
# run: |
# bash ./scripts/cmd-pallets test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test"
#
# cargo-test-clients:
# name: Run Tests for Clients
# needs: cargo-test-pallets
# if: needs.cargo-test-pallets.result == 'success'
# runs-on: ubuntu-latest
# env:
# SOURCE_STELLAR_SECRET_MAINNET: ${{ secrets.SOURCE_STELLAR_SECRET_MAINNET }}
# SOURCE_STELLAR_SECRET_TESTNET: ${{ secrets.SOURCE_STELLAR_SECRET_TESTNET }}
# DEST_STELLAR_SECRET_MAINNET: ${{ secrets.DEST_STELLAR_SECRET_MAINNET }}
# DEST_STELLAR_SECRET_TESTNET: ${{ secrets.DEST_STELLAR_SECRET_TESTNET }}
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
#
# - name: Undergo Prerequisite (for Nightly)
# uses: ./.github/actions/prerequisite-nightly
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# version: ${{ env.RUSTUP_NIGHTLY_VERSION }}
#
# - name: Run Tests for Clients
# run: |
# bash ./scripts/cmd-clients test "+${{ env.RUSTUP_NIGHTLY_VERSION }} test"
cargo-test-vault:
name: Run Tests for Vault
# needs: cargo-test-clients
# if: needs.cargo-test-clients.result == 'success'
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
# - name: Undergo Prerequisite (for Nightly)
# uses: ./.github/actions/prerequisite-nightly
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# version: ${{ env.RUSTUP_NIGHTLY_VERSION }}
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
- name: Install Libs
uses: ./.github/actions/installations
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Cargo cache
uses: actions/cache@v4
with:
path: |
${{ env.CARGO_HOME }}/bin/
${{ env.CARGO_HOME }}/registry/index/
${{ env.CARGO_HOME }}/registry/cache/
${{ env.CARGO_HOME }}/git/db/
key: ${{ github.job }}-${{ github.ref }}-${{ hashFiles('**/Cargo.lock') }}
save-always: true
- name: Install nightly
uses: ./.github/actions/install-rust-nightly
with:
version: ${{ env.RUSTUP_NIGHTLY_VERSION }}
- name: Run Tests for Vault
uses: actions-rs/cargo@v1
env:
SOURCE_STELLAR_SECRET_MAINNET: ${{ secrets.SOURCE_STELLAR_SECRET_MAINNET }}
SOURCE_STELLAR_SECRET_TESTNET: ${{ secrets.SOURCE_STELLAR_SECRET_TESTNET }}
DEST_STELLAR_SECRET_MAINNET: ${{ secrets.DEST_STELLAR_SECRET_MAINNET }}
DEST_STELLAR_SECRET_TESTNET: ${{ secrets.DEST_STELLAR_SECRET_TESTNET }}
with:
toolchain: ${{ env.RUSTUP_NIGHTLY_VERSION }}
command: test
# we only test the standalone-metadata
args: -p vault --features integration-test