Skip to content

WIP

WIP #13

Workflow file for this run

# © 2019-2023 Serokell <[email protected]>
# © 2019-2023 Lars Jellema <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0
name: CI
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- name: reuse lint
run: nix-build -A packages.reuse && result/bin/reuse lint
- name: hlint
run: nix-build -A checks.hlint
- name: treefmt
run: nix-build -A checks.treefmt
- name: build nixfmt
run: nix-build
if: success() || failure()
- name: run tests
run: nix-shell --run ./test/test.sh
auto-format:
needs: check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Nixpkgs diff
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
Nixpkgs diff [processing](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})..
- uses: actions/create-github-app-token@v1
id: app-token
with:
# required
app-id: ${{ vars.app_id }}
private-key: ${{ secrets.app_private_key }}
- uses: cachix/install-nix-action@v20
- uses: actions/checkout@v4
- run: |
./sync-pr.sh \
https://github.com/${{ github.repository }} \
${{ github.event.pull_request.number }} \
https://token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository_owner }}/nixpkgs \
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
[Nixpkgs diff](https://github.com/${{ github.repository_owner }}/nixpkgs/commits/nixfmt-${{ github.event.pull_request.number }})