-
Notifications
You must be signed in to change notification settings - Fork 8
54 lines (46 loc) · 1.72 KB
/
CI.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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
CI:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: ['stable', 'nightly']
steps:
- uses: actions/checkout@v4
- name: Setup mold
run: |
sudo apt install mold clang
echo '[target.x86_64-unknown-linux-gnu]' >> $HOME/.cargo/config.toml
echo 'linker = "clang"' >> $HOME/.cargo/config.toml
echo 'rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"]' >> $HOME/.cargo/config.toml
cat $HOME/.cargo/config.toml
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- name: Cache cargo subcommands
id: cache_cargo_subcommands
uses: actions/cache@v3
with:
key: ${{ runner.os }}-cargo-install--sqlx-sccache
path: ~/.cargo/bin
- name: Install cargo subcommands
if: ${{ steps.cache_cargo_subcommands.outputs.cache-hit != 'true' }}
run: |
cargo install sqlx-cli --no-default-features --features native-tls,postgres
cargo install sccache --locked
- name: Setup sccache
run: |
echo '[build]' >> $HOME/.cargo/config.toml
echo "rustc-wrapper = \"$HOME/.cargo/bin/sccache\"" >> $HOME/.cargo/config.toml
cat $HOME/.cargo/config.toml
- name: Run tasks
run: |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
task test check ${{ matrix.toolchain == 'nightly' && 'bench_dryrun' || '' }}