Skip to content

Commit

Permalink
ci: configure pinact
Browse files Browse the repository at this point in the history
  • Loading branch information
JarvisCraft committed Aug 13, 2024
1 parent ba0622c commit 168f0f2
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run:
working-directory: ${{ inputs.target }}
steps:
- uses: actions/[email protected]
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- run: rustup component add llvm-tools
- run: sudo apt install libudev-dev
- name: Build
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/_lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
run:
working-directory: ${{ inputs.target }}
steps:
- uses: actions/[email protected]
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Install build dependencies
run: sudo apt install libudev-dev
- name: Run Clippy
uses: auguwu/[email protected]
uses: auguwu/clippy-action@4f4a1dcb5f1878376a6232d4112953f3d36c8439 # 1.3.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{ inputs.target }}
Expand All @@ -36,7 +36,7 @@ jobs:
run:
working-directory: ${{ inputs.target }}
steps:
- uses: actions/[email protected]
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Install build dependencies
run: sudo apt install libudev-dev
- uses: dtolnay/rust-toolchain@beta
Expand All @@ -45,7 +45,7 @@ jobs:
components: clippy
- run: rustup override set ${{ steps.toolchain.outputs.name }}
- name: Run Clippy (beta)
uses: auguwu/[email protected]
uses: auguwu/clippy-action@4f4a1dcb5f1878376a6232d4112953f3d36c8439 # 1.3.0
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -62,7 +62,7 @@ jobs:
run:
working-directory: ${{ inputs.target }}
steps:
- uses: actions/[email protected]
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Install build dependencies
run: sudo apt install libudev-dev
# Use nightly Rust (as docs.rs does), because some of our dependencies enable the
Expand All @@ -86,5 +86,5 @@ jobs:
run:
working-directory: ${{ inputs.target }}
steps:
- uses: actions/[email protected]
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- run: cargo fmt --all --check
19 changes: 19 additions & 0 deletions .github/workflows/pinact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Pinact
on:
push: {}
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
-
name: Checkout sources
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
-
name: Install pinact
run: go install github.com/suzuki-shunsuke/pinact/cmd/pinact@latest
-
name: Run pinact
uses: suzuki-shunsuke/pinact-action@a60b07ee63e41654915780a3297ff9f5f6b6db63 # v0.1.0
with:
skip_push: false
6 changes: 3 additions & 3 deletions .github/workflows/update_bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
run: echo '${{ github.event.inputs.sdk_version }}' | grep --perl-regexp '^\d+\.\d+\.\d+$'
-
name: Checkout sources
uses: actions/[email protected]
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
-
name: Set up Docker Buildx
uses: docker/[email protected]
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
-
name: Create branch
run: git checkout -b'github-actions/update-bindings/sdk/${{ github.event.inputs.sdk_version }}'
-
name: Generate bindings
id: generate-bindings
uses: docker/[email protected]
uses: docker/build-push-action@16ebe778df0e7752d2cfcbd924afdbbd89c1a755 # v6.6.1
with:
tags: flipperzero-sdk-bindings:latest
context: .
Expand Down
2 changes: 2 additions & 0 deletions .pinact.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
files:
- pattern: "^\\.github/workflows/.*\\.ya?ml$"
36 changes: 28 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,39 @@
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
outputs =
{
nixpkgs,
flake-utils,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
rust =
pkgs.rust-bin.fromRustupToolchainFile ./crates/rust-toolchain.toml;
in {
rust = pkgs.rust-bin.fromRustupToolchainFile ./crates/rust-toolchain.toml;
in
{
formatter = pkgs.nixfmt-rfc-style;
devShells = {
default = pkgs.mkShell { nativeBuildInputs = [ rust pkgs.python3 ]; };
github-actions = pkgs.mkShell { nativeBuildInputs = [ pkgs.act pkgs.actionlint ]; };
default = pkgs.mkShell {
nativeBuildInputs = [
rust
pkgs.python3
];
};
github-actions = pkgs.mkShell {
nativeBuildInputs = [
pkgs.act
pkgs.actionlint
pkgs.pinact
];
};
};
});
}
);
}

0 comments on commit 168f0f2

Please sign in to comment.