42 lines
999 B
YAML
42 lines
999 B
YAML
name: Rust Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
pull_request:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://gitea.com/actions/checkout@v4
|
|
|
|
- name: Setup Rust + sccache
|
|
id: rust
|
|
uses: https://git.ericxliu.me/eric/actions-rust/.gitea/actions/rust-cache@main
|
|
with:
|
|
toolchain: stable
|
|
sccache-bucket: sccache
|
|
sccache-region: auto
|
|
sccache-endpoint: https://s3.ericxliu.me
|
|
sccache-key-prefix: rust-hello-world/${{ runner.os }}-${{ runner.arch }}/stable
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
|
|
|
|
- name: Build
|
|
run: cargo build --verbose
|
|
|
|
- name: Run
|
|
run: cargo run
|
|
|
|
- name: Show sccache stats
|
|
if: always()
|
|
run: sccache --show-stats || true
|