From 083a171a4011ea7e50792c40bbb4adbd26d55cdb Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Sat, 30 Dec 2023 07:16:26 -0300 Subject: [PATCH] ci: move pre-commit out of build-slides (#70) --- .github/workflows/build-slides.yml | 3 --- .github/workflows/pre-commit.yml | 27 +++++++++++++++++++++++++++ flake.nix | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/build-slides.yml b/.github/workflows/build-slides.yml index f1320ef..ead1fd6 100644 --- a/.github/workflows/build-slides.yml +++ b/.github/workflows/build-slides.yml @@ -25,9 +25,6 @@ jobs: - name: Cache Nix artifacts uses: DeterminateSystems/magic-nix-cache-action@v2 - - name: Nix pre-commit check - run: nix develop -L . --command bash -c 'pre-commit run --all-files' - - name: Build Slides run: nix build -L diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..23c2876 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,27 @@ +name: Pre Commit Checks +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + +jobs: + build-release: + name: Pre Commit Checks + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v9 + + - name: Cache Nix artifacts + uses: DeterminateSystems/magic-nix-cache-action@v2 + + - name: Nix pre-commit check + run: nix develop -L . --command bash -c 'pre-commit run --all-files' diff --git a/flake.nix b/flake.nix index dd3a3a7..0366b96 100644 --- a/flake.nix +++ b/flake.nix @@ -62,7 +62,7 @@ enable = true; name = "format julia code"; entry = '' - ${pkgs.julia-bin}/bin/julia -e ' + ${pkgs.julia}/bin/julia -e ' using Pkg Pkg.activate(".") Pkg.add("JuliaFormatter")