turtlegame/.forgejo/workflows/rust.yml
Dominic e5e2ccfc6b
Some checks failed
Rust / rustfmt (push) Successful in 25s
Rust / clippy (push) Failing after 1m26s
Rust / build (push) Has been cancelled
CI: change folder structure
2024-07-07 17:53:22 +02:00

69 lines
1.9 KiB
YAML

name: Rust
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: https://github.com/dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
- uses: actions/checkout@v4
- uses: https://github.com/dtolnay/rust-toolchain@1.79.0
id: rust-toolchain
with:
components: clippy
- uses: actions/cache@v4
with:
path: |
~/.cargo/git
~/.cargo/registry
target
key: "${{runner.os}} Rust+Clippy ${{steps.rust-toolchain.outputs.cachekey}}"
- run: cargo clippy --locked --all-targets -- -D warnings
env:
RUSTFLAGS: "-D warnings"
build:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
- uses: actions/checkout@v4
- uses: https://github.com/dtolnay/rust-toolchain@stable
id: rust-toolchain
- uses: actions/cache@v4
with:
path: |
~/.cargo/git
~/.cargo/registry
target
key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}"
- run: mkdir .ci-destdir
- run: cargo install --path . --locked --root .
- run: find .ci-destdir
- uses: forgejo/upload-artifact@v3
with:
name: Powercreep
path: |
bin
assets