Skip to content

Commit

Permalink
Merge pull request #48 from EspressoSystems/ma/add-flake-update-action
Browse files Browse the repository at this point in the history
Add action to update flake.lock
  • Loading branch information
sveitser committed Jun 6, 2023
2 parents cdfa42b + f68d834 commit 60df191
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 83 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
env:
RUST_LOG: info
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1

- uses: styfle/cancel-workflow-action@0.9.1
name: Cancel Outdated Builds
with:
Expand All @@ -29,6 +26,11 @@ jobs:
- uses: actions/checkout@v3
name: Checkout Repository

- name: Install Protoc
uses: arduino/setup-protoc@v1

- uses: dtolnay/rust-toolchain@stable

- name: Configure Git
run: |
git config --global url."https://ancient123:${{ secrets.ORG_GITHUB_PAT }}@github.com".insteadOf git://github.com
Expand Down Expand Up @@ -56,7 +58,7 @@ jobs:
- name: Test
run: |
cargo test --workspace --release --all-features --no-run
cargo test --workspace --release --all-features --verbose -- -Zunstable-options --report-time --test-threads 2
cargo test --workspace --release --all-features --verbose -- --test-threads 2
timeout-minutes: 60

- name: Generate Documentation
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@ jobs:
git config --global url."https://ancient123:${{ secrets.ORG_GITHUB_PAT }}@github.com/".insteadOf git://github.com/
git config --global url."https://ancient123:${{ secrets.ORG_GITHUB_PAT }}@github.com/".insteadOf ssh://git@github.com/
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: stable
override: true
default: true
components: rustfmt, clippy
- uses: dtolnay/rust-toolchain@stable

- name: Install Protoc
uses: arduino/setup-protoc@v1
Expand All @@ -59,5 +52,5 @@ jobs:
- name: Test
run: |
cargo test --workspace --release --all-features --no-run
cargo test --workspace --release --all-features --verbose -- -Zunstable-options --report-time --test-threads 2
cargo test --workspace --release --all-features --verbose -- --test-threads 2
timeout-minutes: 60
4 changes: 3 additions & 1 deletion .github/workflows/debug_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v1

- uses: dtolnay/rust-toolchain@stable

- uses: styfle/cancel-workflow-action@0.9.1
name: Cancel Outdated Builds
with:
Expand All @@ -38,5 +40,5 @@ jobs:
- name: Test
run: |
cargo test --workspace --all-features --no-run
cargo test --workspace --all-features --verbose -- -Zunstable-options --report-time --test-threads 2
cargo test --workspace --all-features --verbose -- --test-threads 2
timeout-minutes: 60
26 changes: 26 additions & 0 deletions .github/workflows/update_nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: update-flake-lock

on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00

jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Nix
uses: cachix/install-nix-action@v21

- uses: cachix/cachix-action@v12
with:
name: espresso-systems-private
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@v19
with:
pr-title: "Weekly PR to bump flake.nix" # Title of PR to be created
119 changes: 58 additions & 61 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,13 @@

inputs.rust-overlay.url = "github:oxalica/rust-overlay";

inputs.fenix.url = "github:nix-community/fenix";
inputs.fenix.inputs.nixpkgs.follows = "nixpkgs";

inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
inputs.pre-commit-hooks.inputs.flake-utils.follows = "flake-utils";
inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";

outputs = { self, nixpkgs, flake-utils, flake-compat, rust-overlay, fenix, pre-commit-hooks, ... }:
outputs = { self, nixpkgs, flake-utils, rust-overlay, pre-commit-hooks, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
info = builtins.split "\([a-zA-Z0-9_]+\)" system;
arch = (builtins.elemAt (builtins.elemAt info 1) 0);
os = (builtins.elemAt (builtins.elemAt info 3) 0);
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
rustToolchain = pkgs.rust-bin.stable.latest.minimal.override {
Expand Down Expand Up @@ -159,7 +153,7 @@
+ self.checks.${system}.pre-commit-check.shellHook;
buildInputs = with pkgs;
[
fenix.packages.${system}.rust-analyzer
rust-bin.nightly.latest.rust-analyzer
nixWithFlakes
nixpkgs-fmt
git
Expand Down

0 comments on commit 60df191

Please sign in to comment.