Skip to content

Commit

Permalink
ci: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Feb 16, 2024
1 parent 89873e9 commit 2f5ff1f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 38 deletions.
26 changes: 26 additions & 0 deletions .github/runners/build-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Common

on:
workflow_call:
inputs:
platform:
default: "ubuntu-latest"
required: false
type: string
github_token:
required: true

jobs:
build-common:
- name: Maximize Space
uses: easimon/maximize-build-space@v10
with:
overprovision-lvm: true
remove-android: true
remove-dotnet: true
remove-haskell: true

- name: Common
uses: ./.github/runners/common.yml
with:
github_token: ${{ inputs.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/runners/common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Common

on:
workflow_call:
inputs:
platform:
default: "ubuntu-latest"
required: false
type: string
github_token:
required: true

jobs:
common:
runs-on: ${{ inputs.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ inputs.github_token }}

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

- name: Nix Magic Cache
uses: DeterminateSystems/magic-nix-cache-action@main
22 changes: 4 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,11 @@ jobs:
- plymouth-theme-catppuccin

steps:
- name: Maximize Space
uses: easimon/maximize-build-space@v10
- name: Prepare Environment
uses: ./.github/runners/build-common.yml
with:
overprovision-lvm: true
remove-android: true
remove-dotnet: true
remove-haskell: true

- name: Checkout
uses: actions/checkout@v4

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

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

github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup cachix
uses: cachix/cachix-action@v14
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Prepare Environment
uses: ./.github/runners/common.yml
with:
logger: pretty

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

github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Check Flake
run: nix flake check --accept-flake-config

Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ jobs:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install nix
uses: cachix/install-nix-action@v25
- name: Prepare Environment
uses: ./.github/runners/common.yml
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build Linux packages
run: "nix build -L .#docs-html"
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Install Nix
uses: nixbuild/nix-quick-install-action@v26
- name: Prepare Environment
uses: ./.github/runners/common.yml
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Update Lockfile
uses: DeterminateSystems/update-flake-lock@main
Expand Down

0 comments on commit 2f5ff1f

Please sign in to comment.