Random123 behavior tests #4546
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check formatting | |
concurrency: | |
# Don't cancel on master, creating a PR when a push workflow is already going will cancel the push workflow in favour of the PR workflow | |
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_id || github.event.number && github.head_ref || github.ref_name }} | |
cancel-in-progress: true | |
on: | |
merge_group: | |
push: | |
branches: | |
- release/** | |
pull_request: | |
branches: | |
- master | |
- release/** | |
jobs: | |
all: | |
name: C/C++, CMake and Python | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update submodule | |
working-directory: ${{runner.workspace}}/nrn | |
run: git submodule update --init external/coding-conventions | |
- name: Check formatting | |
working-directory: ${{runner.workspace}}/nrn | |
run: external/coding-conventions/bin/format -v --dry-run | |
# If formatting fails, apply formatting and push changes. | |
# This will trigger another workflow run, which will cancel the current one. | |
- name: Apply formatting | |
working-directory: ${{runner.workspace}}/nrn | |
if: failure() && github.event_name == 'pull_request' | |
run: | | |
# Checkout PR | |
gh pr checkout ${{ github.event.pull_request.number }} | |
# Apply formatting | |
external/coding-conventions/bin/format -v | |
# Commit & push changes | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add -u :/ | |
git commit -a -m "Fix formatting" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |