mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2025-02-05 13:24:33 +00:00
3e3df07269
This change is necessary before enabling merge queues. The `merge_group` event is needed to trigger the GitHub Actions workflow when a pull request is added to a merge queue. The merge queue provides the same benefits as the Require branches to be up to date before merging branch protection but does not require a pull request author to update their pull request branch and wait for status checks to finish before trying to merge. More info on https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue.
35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
name: Linters
|
|
|
|
on:
|
|
pull_request:
|
|
merge_group:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
nph:
|
|
name: NPH
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base
|
|
|
|
- name: Setup NPH
|
|
# Pin nph to a specific version to avoid sudden style differences.
|
|
# Updating nph version should be accompanied with running the new version on the fluffy directory.
|
|
run: |
|
|
VERSION="v0.5.1"
|
|
ARCHIVE="nph-linux_x64.tar.gz"
|
|
curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE}
|
|
tar -xzf ${ARCHIVE}
|
|
|
|
- name: Check style
|
|
run: |
|
|
shopt -s extglob # Enable extended globbing
|
|
./nph examples libp2p tests tools *.@(nim|nims|nimble)
|
|
git diff --exit-code
|