Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to flake #12

Merged
merged 5 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@v6

- name: Build book
shell: bash
run: |
nix build
run: nix build .#book

- name: Setup Pages
uses: actions/configure-pages@v5
Expand Down
38 changes: 6 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,13 @@ permissions:
contents: read

jobs:
build:
check:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- "1.74"
- stable
- beta
- nightly
cargo-update:
- true
include:
- rust: stable
cargo-update: false
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
- uses: cachix/install-nix-action@v27
with:
toolchain: ${{ matrix.rust }}
- name: Update
if: matrix.cargo-update
run: cargo update
- name: Run tests
run: cargo test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt clippy
- name: Run rustfmt check
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all --all-targets -- -D warnings
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v6
- name: Run checks
run: nix flake check
30 changes: 30 additions & 0 deletions .github/workflows/update-rust-overlay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update rust-overlay
on:
schedule:
- cron: "0 3 * * *" # Every day 03:00 UTC
jobs:
update:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix flake lock --update-input rust-overlay
- name: Commit changes
id: commit
continue-on-error: true
run: |
git config user.name "Github Action"
git config user.email "[email protected]"
git add flake.lock
git commit -m "build: update rust-overlay"
- name: Push changes
if: steps.commit.outcome == 'success'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main

4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# will have compiled files and executables
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
Loading
Loading