-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from danieldickison/build
Build via GH Actions
- Loading branch information
Showing
2 changed files
with
61 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,41 @@ | ||
name: Rust build, test and clippy | ||
name: Rust Build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3.5.2 | ||
|
||
- uses: actions/checkout@v4 | ||
- name: Cache rust target files | ||
uses: actions/cache@v3.3.1 | ||
uses: actions/cache@v4 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-rust-target | ||
|
||
- run: sudo npm install -g sass | ||
|
||
- name: Check | ||
run: cargo check --verbose --all-targets --locked | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} | ||
save-always: true | ||
- name: Install sass | ||
run: sudo npm install -g sass | ||
- name: Run tests | ||
run: cargo test --verbose | ||
run: cargo test --verbose --all-targets --locked | ||
- name: Clippy | ||
run: cargo clippy --verbose --no-deps --all-targets --locked | ||
- name: Build | ||
run: cargo build --bin=server --release --locked --verbose | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-output | ||
path: | | ||
target/release/server | ||
public/ | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters