-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (85 loc) · 2.59 KB
/
Copy pathci.yml
File metadata and controls
90 lines (85 loc) · 2.59 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
84
85
86
87
88
89
90
name: CI
on:
push:
pull_request:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
CARGO_TARGET_DIR: target
jobs:
rust:
name: Rust lint and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: pd-controller
- uses: actions/checkout@v4
with:
repository: rustscript-lang/pd-edge
path: pd-edge
- uses: actions/checkout@v4
with:
repository: rustscript-lang/rustscript
path: rustscript
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Format check
working-directory: pd-controller
run: cargo fmt --all -- --check
- name: Clippy
working-directory: pd-controller
run: cargo clippy --workspace --all-targets --all-features
- name: Tests
working-directory: pd-controller
run: cargo test --workspace
controller:
name: pd-controller binary (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
path: pd-controller
- uses: actions/checkout@v4
with:
repository: rustscript-lang/pd-edge
path: pd-edge
- uses: actions/checkout@v4
with:
repository: rustscript-lang/rustscript
path: rustscript
- uses: dtolnay/rust-toolchain@stable
- uses: oven-sh/setup-bun@v2
- name: Build controller web UI
working-directory: pd-controller/webui
run: |
bun install --frozen-lockfile
bun run build
env:
RUSTSCRIPT_REPO: ${{ github.workspace }}/rustscript
- name: Build pd-controller
working-directory: pd-controller
run: cargo build -p pd-controller --release
- name: Stage pd-controller artifact
shell: bash
working-directory: pd-controller
run: |
mkdir -p dist
suffix=""
if [[ "${{ runner.os }}" == "Windows" ]]; then suffix=".exe"; fi
cp "target/release/pd-controller${suffix}" "dist/pd-controller-${{ runner.os }}-${{ runner.arch }}${suffix}"
- uses: actions/upload-artifact@v4
with:
name: pd-controller-${{ runner.os }}-${{ runner.arch }}
path: pd-controller/dist/*
- name: Upload pd-controller release asset
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: pd-controller/dist/*