Skip to content

Commit

Permalink
ci: refactor out common build steps in CI pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiebrynes7 committed Aug 31, 2024
1 parent f641786 commit bb89b7e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 40 deletions.
13 changes: 13 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Common Setup"
description: "Sets up Nix and the development environment"
runs:
using: "composite"
steps:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Setup Magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Use nix-develop shell
uses: nicknovitski/nix-develop@v1.1.0
with:
arguments: ./nix --impure
12 changes: 2 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Setup Magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Use nix-develop shell
uses: nicknovitski/nix-develop@v1.1.0
with:
arguments: ./nix --impure
- name: Setup
uses: ./.github/actions/setup

- name: Install dependencies
run: npm install
Expand Down
24 changes: 4 additions & 20 deletions .github/workflows/premerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Setup Magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Use nix-develop shell
uses: nicknovitski/nix-develop@v1.1.0
with:
arguments: ./nix --impure
- name: Setup
uses: ./.github/actions/setup

- name: Install dependencies
run: npm install
Expand All @@ -44,16 +36,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Setup Magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Use nix-develop shell
uses: nicknovitski/nix-develop@v1.1.0
with:
arguments: ./nix --impure
- name: Setup
uses: ./.github/actions/setup

- name: Install dependencies
run: npm install
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Setup Magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Use nix-develop shell
uses: nicknovitski/nix-develop@v1.1.0
with:
arguments: ./nix --impure
- name: Setup
uses: ./.github/actions/setup

- name: Install dependencies
run: npm install
Expand Down

0 comments on commit bb89b7e

Please sign in to comment.