Skip to content

Commit

Permalink
CI: add reusable actions
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Sep 11, 2023
1 parent 1e60802 commit da6b7e2
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 110 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/man-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ jobs:
steps:
- name: Install deps
run: sudo apt install pandoc

- name: Clone repository
uses: actions/checkout@v3
# Not needed
# with:
# submodules: recursive

- name: Build man pages
run: make man

- uses: stefanzweifel/git-auto-commit-action@v4
name: Commit
with:
commit_message: "[gha] build man pages"
commit_user_name: Mihai Fufezan
commit_user_email: [email protected]
commit_author: Mihai Fufezan <[email protected]>
push_options: --force
26 changes: 0 additions & 26 deletions .github/workflows/nix-build.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
workflow_call:
secrets:
CACHIX_AUTH_TOKEN:
required: false

jobs:
build:
strategy:
matrix:
package:
- hyprland
- hyprland-nvidia
- xdg-desktop-portal-hyprland

runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}

- name: Install Nix
uses: cachix/install-nix-action@v22
with:
install_url: https://nixos.org/nix/install
extra_nix_config: |
auto-optimise-store = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v12
with:
name: hyprland
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- run: nix build -L ${{ matrix.command }}
12 changes: 12 additions & 0 deletions .github/workflows/nix-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Nix

on: [push, pull_request, workflow_dispatch]

jobs:
wlroots:
uses: ./.github/workflows/nix-update-wlroots.yml

build:
needs: wlroots
uses: ./.github/workflows/nix-build.yml
secrets: inherit
40 changes: 0 additions & 40 deletions .github/workflows/nix-update-inputs.yaml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/nix-update-inputs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Nix

on:
schedule:
- cron: '0 0 * * *' # check daily

jobs:
update:
name: inputs
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Install nix
uses: cachix/install-nix-action@v22
with:
install_url: https://nixos.org/nix/install
extra_nix_config: |
auto-optimise-store = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes
- name: Update inputs
run: nix/update-inputs.sh

- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[gha] Nix: update inputs"
push_options: --force

update-build:
needs: update
uses: ./.github/workflows/nix-build.yml
secrets: inherit
38 changes: 0 additions & 38 deletions .github/workflows/nix-update-wlroots.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/nix-update-wlroots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Nix

on:
workflow_call:

jobs:
update:
name: wlroots
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Install nix
uses: cachix/install-nix-action@v22
with:
install_url: https://nixos.org/nix/install
extra_nix_config: |
auto-optimise-store = true
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes
- name: Update lockfile
run: nix/update-wlroots.sh

- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[gha] Nix: update wlroots"
push_options: --force

0 comments on commit da6b7e2

Please sign in to comment.