Skip to content

Commit

Permalink
Merge pull request #71 from epics-extensions/github-nix-build
Browse files Browse the repository at this point in the history
add Nix build as GitHub action
  • Loading branch information
minijackson authored Dec 12, 2023
2 parents 4efa3b4 + 72f8bd6 commit 314f010
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/editorconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ permissions: read-all

on:
push:
branches: [master]
pull_request:

jobs:
editorconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: cachix/install-nix-action@v24
- name: "Check EditorConfig"
# Python already has Ruff,
# and doesn't necessarily have a consistent 4 spaces indent
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Nix build"

permissions: read-all

on:
# Allows running this workflow manually
workflow_dispatch:
push:
branches: [master]
pull_request:

jobs:
nix-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v24
- uses: DeterminateSystems/magic-nix-cache-action@v2
with:
diagnostic-endpoint: ""
- name: Run `nix build`
run: nix build -L .
14 changes: 11 additions & 3 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
name: "Check Formatting"
name: "Ruff lints"

permissions: read-all

on:
push:
branches: [master]
pull_request:

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
with:
files: |
**.py
- uses: cachix/install-nix-action@v24
- name: "Check Ruff lints"
run: nix run 'nixpkgs#ruff' -- check . --output-format=github
if: steps.changed-files.outputs.any_changed == 'true'
run: nix run 'nixpkgs#ruff' -- check . --output-format=github ${{ steps.changed-files.outputs.all_changed_files }}

0 comments on commit 314f010

Please sign in to comment.