Skip to content

Commit

Permalink
Workflows: overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Aug 9, 2023
1 parent 94790ce commit 42b469b
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 59 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build

on:
workflow_call:

jobs:
build:
strategy:
matrix:
package:
- faf-client
- faf-client-unstable
- proton-ge
- wine-ge
- wine-osu
- wine-tkg

uses: ./.github/workflows/nix.yml
with:
command: nix build -L .#${{ matrix.package }}
26 changes: 11 additions & 15 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ name: Checks
on: [push, pull_request, workflow_dispatch]

jobs:
checks:
name: Check expressions
runs-on: ubuntu-latest
check:
strategy:
matrix:
command:
- 'nix flake check --accept-flake-config'
- 'nix run nixpkgs#alejandra -- -c . -e ./npins'
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v20
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
- run: ${{ matrix.command }}
- nix flake check --accept-flake-config
- nix run nixpkgs#alejandra -- -c . -e ./npins

uses: ./.github/workflows/nix.yml
with:
command: ${{ matrix.command }}

build:
needs: check
uses: ./.github/workflows/build.yml
31 changes: 0 additions & 31 deletions .github/workflows/ci.yml

This file was deleted.

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

on:
workflow_call:
inputs:
command:
required: true
type: string

jobs:
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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: nix-gaming
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: ${{ inputs.command }}
35 changes: 22 additions & 13 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,28 @@ on:
- cron: '0 0 * * *'

jobs:
cachix:
name: Update sources
runs-on: ubuntu-latest
update:
strategy:
matrix:
command:
- nix run nixpkgs#npins update
- pkgs/faf-client/update.sh
- pkgs/faf-client/update-src.sh
- pkgs/osu-lazer-bin/update.sh
- pkgs/osu-stable/update.sh
- pkgs/wine/update-wine-ge.sh

uses: ./.github/workflows/nix.yml
with:
command: ${{ matrix.command }}

build:
needs: update
uses: ./.github/workflows/build.yml

push:
needs: build
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v20
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
- run: nix run nixpkgs#npins update; pkgs/osu-lazer-bin/update.sh; pkgs/osu-stable/update.sh; pkgs/faf-client/update.sh; pkgs/wine/update-wine-ge.sh; pkgs/faf-client/update-src.sh
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[gha] bump npins inputs"
commit_message: "Update inputs"

0 comments on commit 42b469b

Please sign in to comment.