Skip to content

Commit

Permalink
Merge pull request #2 from nikmctrl/ci-optimisation
Browse files Browse the repository at this point in the history
Ci optimisation
  • Loading branch information
nikmctrl authored Jan 3, 2025
2 parents b827fe3 + efcdcd9 commit deb7331
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 11 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/ci-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: "Nix Omnix CI"
on:
push:
pull_request:



jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -13,12 +12,33 @@ jobs:
os: [ubuntu-22.04, macos-14]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hyprflake.cachix.org-1:7fpoBMQuosbaoqxQ5bsxR2GPVQ3mjBp7dfziXc4e+hM=
substituters = https://cache.nixos.org/ https://hyprflake.cachix.org
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- name: Install Cachix and Omnix
run: "nix profile install --accept-flake-config github:juspay/omnix nixpkgs#cachix"
- name: Authenticate Cachix
run: "cachix authtoken ${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build all flake outputs and push to Cachix
run: "om ci | cachix push hyprflake"
formatted:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hyprflake.cachix.org-1:7fpoBMQuosbaoqxQ5bsxR2GPVQ3mjBp7dfziXc4e+hM=
substituters = https://cache.nixos.org/ https://hyprflake.cachix.org
- run: "nix profile install --accept-flake-config github:juspay/omnix nixpkgs#cachix"
- run: "cachix authtoken ${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: "om ci | cachix push hyprflake"
- run: nix flake check
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check flake
run: "nix flake check"
needs: build
21 changes: 21 additions & 0 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: update-flake-lock
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
pr-title: "Update flake.lock" # Title of PR to be created
pr-labels: | # Labels to be set on the PR
dependencies
automated
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"editor.formatOnSave": true,
"rust-analyzer.files.excludeDirs": [
".direnv"
],
"nixEnvSelector.nixFile": "${workspaceFolder}/flake.nix"
"rust-analyzer.files.excludeDirs": [".direnv"],
"nixEnvSelector.nixFile": "${workspaceFolder}/flake.nix",
"github-actions.workflows.pinned.workflows": []
// https://twitter.com/sridca/status/1674947342607216641
// "editor.inlayHints.enabled": "offUnlessPressed",
}
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ doc:

# Auto-format the source tree
fmt:
treefmt --allow-missing-formatter

fmt-ci:
treefmt --allow-missing-formatter --no-cache --fail-on-change

# Run 'cargo run' on the project
Expand Down
1 change: 1 addition & 0 deletions om.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ health:
- https://nix-community.cachix.org
direnv:
required: true

develop:
default:
readme: |
Expand Down

0 comments on commit deb7331

Please sign in to comment.