linutil/.github/workflows/rust.yml

44 lines
1.0 KiB
YAML
Raw Normal View History

2024-07-13 22:58:12 +01:00
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
2024-07-13 23:35:48 +01:00
permissions:
contents: write
2024-07-13 22:58:12 +01:00
env:
CARGO_TERM_COLOR: always
jobs:
2024-07-13 23:49:23 +01:00
build_and_test:
2024-07-13 22:58:12 +01:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-07-18 22:03:27 +01:00
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-registry-
- name: Cache Cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-index-
2024-07-13 23:04:40 +01:00
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
2024-07-13 22:58:12 +01:00
- name: Build
2024-07-18 23:15:07 +01:00
run: cargo build --target-dir=build --release --verbose
2024-07-18 22:37:46 +01:00
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Commit Linutil
2024-07-18 23:15:07 +01:00
file_pattern: 'build/release/linutil'
2024-07-18 22:37:46 +01:00
if: success()
2024-07-18 22:29:02 +01:00