Skip to content

Commit

Permalink
trying to do github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tocklime committed Aug 12, 2024
1 parent 63f0752 commit d3dcb10
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/nix-github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Nix Flake actions

on:
pull_request:
push:
branches:
- master
- main

jobs:
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix-build:
needs: nix-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- run: nix build -L '.#${{ matrix.attr }}'
21 changes: 21 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@
url = "github:jthlim/javelin-steno-rp2040";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-github-actions = {
url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, flake-utils, javelin, javelin-rp2040 }:
outputs = { self, nixpkgs, flake-utils, javelin, javelin-rp2040, nix-github-actions }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
Expand All @@ -32,6 +39,7 @@
deps = with pkgs; [ cmake gcc-arm-embedded local-pico-sdk python3];
my_yask_file = ./yask.h;
in rec {
githubActions = nix-github-actions.lib.mkGithubMatrix { checks = self.packages; };
packages.default = pkgs.stdenv.mkDerivation {
name = "javelin-rp2040";
src = javelin-rp2040;
Expand Down

0 comments on commit d3dcb10

Please sign in to comment.