Skip to content

Commit

Permalink
Run static checks in CI and compile only on master
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Guggi authored and florg-32 committed Sep 15, 2024
1 parent abee61c commit 309195b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 22 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Compile for the RPi

on:
push:
branches: [ "master" ]
workflow_dispatch:

jobs:
cross-compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build
run: |
cross build --examples --bins --release --target aarch64-unknown-linux-gnu
mv target/aarch64-unknown-linux-gnu/release/STS1_EDU_Scheduler .
mv target/aarch64-unknown-linux-gnu/release/examples/cli .
cp scheduler/config.toml .
cp scheduler/scheduler.service .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: aarch64 package
path: |
STS1_EDU_Scheduler
config.toml
scheduler.service
cli
30 changes: 8 additions & 22 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Build & Test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

Expand All @@ -21,25 +19,13 @@ jobs:
- name: Run tests
run: cargo test --release --features mock

cross-compile:
static-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build
run: |
cross build --examples --bins --release --target aarch64-unknown-linux-gnu
mv target/aarch64-unknown-linux-gnu/release/STS1_EDU_Scheduler .
mv target/aarch64-unknown-linux-gnu/release/examples/cli .
cp scheduler/config.toml .
cp scheduler/scheduler.service .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: aarch64 package
path: |
STS1_EDU_Scheduler
config.toml
scheduler.service
cli
- uses: actions/checkout@v4
- name: Install
run: sudo apt install libudev-dev
- name: Clippy
run: cargo clippy -- -D warnings
- name: Formatting
run: cargo fmt --all --check

0 comments on commit 309195b

Please sign in to comment.