yourcloud/.forgejo/workflows/build.yaml

81 lines
1.6 KiB
YAML
Raw Normal View History

on: [push]
jobs:
2024-08-06 09:07:57 -05:00
formatting-nix:
runs-on: beefcake
steps:
- name: Checkout
uses: actions/checkout@v3
- name: alejandra -c .
run: 'nix shell nixpkgs#alejandra -c alejandra -c .'
2024-08-06 09:59:05 -05:00
build:
runs-on: beefcake
steps:
- name: Checkout
uses: actions/checkout@v3
2024-08-06 09:59:05 -05:00
- name: Cache
id: cache-build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-build
- name: cargo build
run: 'nix develop .#rust-build -c cargo build'
2024-08-06 09:59:05 -05:00
test:
runs-on: beefcake
steps:
- name: Checkout
uses: actions/checkout@v3
2024-08-06 09:59:05 -05:00
- name: Cache
id: cache-test
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-test
- name: Cache
id: cache-test
uses: actions/cache@v4
with:
path: prime-numbers
key: ${{ runner.os }}-build
- name: cargo test
run: 'nix develop .#rust-build -c cargo test'
2024-08-06 09:59:05 -05:00
2024-08-06 09:07:57 -05:00
formatting-rust:
runs-on: beefcake
steps:
- name: Checkout
uses: actions/checkout@v3
2024-08-06 09:59:05 -05:00
- name: Cache
id: cache-formatting
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-formatting
- name: cargo fmt --check
run: 'nix develop .#rust-build -c cargo fmt --check'
2024-08-06 09:59:05 -05:00
lint:
runs-on: beefcake
steps:
- name: Checkout
uses: actions/checkout@v3
2024-08-06 09:59:05 -05:00
- name: Cache
id: cache-lint
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-lint
- name: cargo clippy
run: 'nix develop .#rust-build -c cargo clippy'