-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (72 loc) · 2.07 KB
/
rust.yml
File metadata and controls
83 lines (72 loc) · 2.07 KB
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
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
target
~/.cargo
key: ${{ matrix.os }}-migorithm-${{ hashFiles('**/Cargo.toml') }}
- name: Print Target
run: rustup show
build-static-ubuntu:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
target
~/.cargo
~/.rustup
key: ubuntu-static-build-${{ hashFiles('**/Cargo.toml') }}
- name: Setup dependency
run: |
sudo apt install -y musl-tools
rustup target add x86_64-unknown-linux-musl
# - name: Build Debug
# run: |
# RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-unknown-linux-gnu --verbose
# cargo build --target x86_64-unknown-linux-musl --verbose
# - name: Build Release
# run: |
# RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-unknown-linux-gnu --release --verbose
# cargo build --target x86_64-unknown-linux-musl --release --verbose
tests:
needs: build-static-ubuntu
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
target
~/.cargo
key: ${{ matrix.os }}-migorithm-${{ hashFiles('**/Cargo.toml') }}
- name: Start containers
run: |
docker-compose -f "docker-compose.yml" up -d --build
docker-compose ps
cargo install sqlx-cli --no-default-features --features native-tls,postgres
make upgrade
- name: Lint tests
run: cargo clippy
- name: Run tests
run: cargo test -- --test-threads 1 --nocapture