-
Notifications
You must be signed in to change notification settings - Fork 1
252 lines (232 loc) · 8.21 KB
/
rust.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
name: Rust-CI
on:
workflow_dispatch:
# schedule:
# - cron: "17 17 * * *"
pull_request:
# types: [labeled, review_requested]
push:
tags:
- "v*.*.*"
jobs:
coverage:
name: Test and Coverage
if: github.actor == 'iesahin'
runs-on: macos-latest
timeout-minutes: 50
strategy:
matrix:
build: [stable]
include:
- build: stable
rust: stable
# rust: nightly-2024-01-01
test-args: --features test-ci # --no-fail-fast
## for submitters other than me, I'll add another job here.
# benches: true
coverage: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DIGITAL_OCEAN_ACCESS_KEY_ID: ${{ secrets.DIGITAL_OCEAN_ACCESS_KEY_ID }}
DIGITAL_OCEAN_SECRET_ACCESS_KEY: ${{ secrets.DIGITAL_OCEAN_SECRET_ACCESS_KEY }}
# WASABI_ACCESS_KEY_ID: ${{ secrets.WASABI_ACCESS_KEY_ID }}
# WASABI_SECRET_ACCESS_KEY: ${{ secrets.WASABI_SECRET_ACCESS_KEY }}
GCS_ACCESS_KEY_ID: ${{ secrets.GCS_ACCESS_KEY_ID }}
GCS_SECRET_ACCESS_KEY: ${{ secrets.GCS_SECRET_ACCESS_KEY }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
MINIO_ACCESS_KEY_ID: ${{ secrets.MINIO_ACCESS_KEY_ID }}
MINIO_SECRET_ACCESS_KEY: ${{ secrets.MINIO_SECRET_ACCESS_KEY }}
XVC_TEST_ONE_EMRESULT_COM_KEY: ${{ secrets.XVC_TEST_ONE_EMRESULT_COM_KEY }}
# We don't run xvc-storage and how-to tests here
XVC_TRYCMD_TESTS: core,file,pipeline,intro,start,storage
XVC_TRYCMD_STORAGE_TESTS: minio,generic,local,
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install required packages
run: |
brew install s3cmd
brew install ripgrep
brew install tree
brew install lsd
brew install python3
brew install minio/stable/mc
- name: Git config for automated Git tests
run: git config --global user.name 'Xvc Rabbit' && git config --global user.email '[email protected]' && git config --global init.defaultBranch main
- name: Write the private key file for e1.xvc.dev connection
run: mkdir -p $HOME/.ssh/ && echo "${XVC_TEST_ONE_EMRESULT_COM_KEY}" > $HOME/.ssh/id_rsa ; chmod 600 ~/.ssh/id_rsa
- name: Write an ssh config to allow connection without noise
run: echo 'Host *' >> $HOME/.ssh/config ; echo ' StrictHostKeyChecking no' >> $HOME/.ssh/config ; echo ' LogLevel ERROR' >> $HOME/.ssh/config ; chmod 400 $HOME/.ssh/config
# - name: List .ssh contents
# run: ls -R $HOME/.ssh ; cat $HOME/.ssh/id_rsa ; cat $HOME/.ssh/config
#
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust || 'stable' }}
components: llvm-tools-preview
- name: Build debug
run: cargo build ${{ matrix.build-args }}
env:
RUSTFLAGS: "-A dead_code"
- name: Add xvc to PATH
run: echo "${GITHUB_WORKSPACE}/target/debug" >> $GITHUB_PATH
# - name: Print contents of $GITHUB_WORKSPACE
# run: tree $GITHUB_WORKSPACE
- name: Check if xvc is in PATH
# run: tree $GITHUB_WORKSPACE && xvc --version
run: xvc --version
# - name: Test
# if: matrix.coverage
# run: cargo test ${{ matrix.test-args }}
# env:
# CARGO_INCREMENTAL: "0"
# # To debug the output when commands fail
# TRYCMD: "dump"
# # RUSTFLAGS: "-Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
# RUSTFLAGS: "-Cinstrument-coverage"
# # RUSTDOCFLAGS: "-Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
# LLVM_PROFILE_FILE: "${TMPDIR}/xvc-%p-%m.profraw"
#
- name: Install cargo-llvm-cov
if: matrix.coverage
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run Current Dev Tests
run: $GITHUB_WORKSPACE/run-tests.zsh
- name: Test and Coverage
id: coverage
if: matrix.coverage
run: cargo llvm-cov ${{ matrix.test-args }} --workspace --lcov --output-path lcov.info
env:
# To debug the output when commands fail
TRYCMD: "dump"
- name: Upload to codecov.io
if: matrix.coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.coverage.outputs.report }}
- name: Test all benches
if: matrix.benches
run: cargo test --benches ${{ matrix.features }}
# deploy-linux:
# name: deploy-linux
# needs: [coverage]
# if: startsWith(github.ref, 'refs/tags/')
# runs-on: ubuntu-latest
# strategy:
# matrix:
# target:
# [
# x86_64-unknown-linux-gnu,
# aarch64-unknown-linux-gnu,
# aarch64-linux-android,
# ]
#
# steps:
# - name: Checkout
# uses: actions/checkout@v1
#
# - name: Install rust
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: stable
# targets: ${{ matrix.target }}
#
# - name: Build target
# run: cargo build --release --target ${{ matrix.target }} --features=bundled-openssl
#
# - name: Package
# shell: bash
# run: |
# #strip target/${{ matrix.target }}/release/xvc
# cd target/${{ matrix.target }}/release
# tar czvf ../../../xvc-${{ github.ref_name }}-${{ matrix.target }}.tar.gz xvc
# cd -
#
# - name: Publish
# uses: softprops/action-gh-release@v1
# # TODO: if any of the build step fails, the release should be deleted.
# with:
# files: "xvc*"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# deploy-windows:
# name: deploy-windows
# needs: [coverage]
# if: startsWith(github.ref, 'refs/tags/')
# runs-on: windows-latest
# strategy:
# matrix:
# target: [x86_64-pc-windows-gnu]
# steps:
# - name: Checkout
# uses: actions/checkout@v1
#
# - name: Install rust
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: stable
# targets: ${{ matrix.target }}
#
# - name: Build target
# run: cargo build --release --target ${{ matrix.target }} --features bundled-sqlite
#
# - name: Package
# shell: bash
# run: |
# #strip target/${{ matrix.target }}/release/xvc
# cd target/${{ matrix.target }}/release
# tar czvf ../../../xvc-${{ github.ref_name}}-${{ matrix.target }}.tar.gz xvc
# cd -
#
# - name: Publish
# uses: softprops/action-gh-release@v1
# # TODO: if any of the build step fails, the release should be deleted.
# with:
# files: "xvc*"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
# deploy-macos:
# name: deploy-macos
# needs: [coverage]
# if: startsWith(github.ref, 'refs/tags/')
# runs-on: macos-latest
# strategy:
# matrix:
# target:
# [x86_64-apple-darwin, aarch64-apple-darwin, x86_64-unknown-freebsd]
#
# steps:
# - name: Checkout
# uses: actions/checkout@v1
#
# - name: Install rust
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: stable
# targets: ${{ matrix.target }}
#
# - name: Build target
# run: cargo build --release --target ${{ matrix.target }}
#
# - name: Package
# shell: bash
# run: |
# #strip target/${{ matrix.target }}/release/xvc
# cd target/${{ matrix.target }}/release
# tar czvf ../../../xvc-${{ github.ref_name}}-${{ matrix.target }}.tar.gz xvc
# cd -
#
# - name: Publish
# uses: softprops/action-gh-release@v1
# # TODO: if any of the build step fails, the release should be deleted.
# with:
# files: "xvc*"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}