Repository navigation
74 lines (62 loc) · 2.22 KB
/
Copy pathmvp-ci.yml
File metadata and controls
74 lines (62 loc) · 2.22 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
name: MVP CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches: [main]
permissions:
contents: read
concurrency:
group: mvp-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
name: MVP backend
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
CARGO_INCREMENTAL: "0"
steps:
- name: Checkout ASAPQuery-backend
uses: actions/checkout@v4
with:
path: ASAPQuery-backend
- name: Install Rust components
run: rustup component add rustfmt clippy
- name: Configure private Cargo dependencies
env:
ASAP_CI_REPO_TOKEN: ${{ secrets.ASAP_CI_REPO_TOKEN }}
run: git config --global url."https://x-access-token:${ASAP_CI_REPO_TOKEN}@github.com/".insteadOf "https://github.com/"
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
workspaces: ASAPQuery-backend
# The compiled workspace fills the hosted runner before the cache
# post-step can package `target`; registry/git inputs are sufficient.
cache-targets: false
- name: Test Planner dependency updater
working-directory: ASAPQuery-backend
run: |
python3 -m unittest discover -s scripts/ci -p 'test_*.py'
node scripts/ci/test_planner_merge.js
- name: Check workspace formatting
working-directory: ASAPQuery-backend
run: cargo fmt -p control_plane -p data_plane -- --check
- name: Check workspace
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
working-directory: ASAPQuery-backend
run: cargo check --workspace --locked
- name: Lint workspace
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
working-directory: ASAPQuery-backend
run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Test workspace
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
working-directory: ASAPQuery-backend
run: cargo test --workspace --locked