update versions of used github actions (#30) #71
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: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm ci | |
- run: npm test | |
- name: clang-format (diff) | |
if: github.event_name == 'pull_request' | |
env: | |
BASE: ${{ github['base_ref'] }} | |
run: | | |
git fetch --no-tags --prune --depth=1 origin +refs/heads/$BASE:refs/remotes/origin/$BASE | |
npm run git-clang-format -- --diff origin/$BASE |\ | |
awk -v s="^diff" '$0~s{r=1} 1; END{exit(r)}' | |
- name: clang-format (project) | |
if: github.event_name == 'push' | |
run: | | |
npm run git-clang-format -- --diff --commit $(git hash-object -t tree /dev/null) |\ | |
awk -v s="^diff" '$0~s{r=1} 1; END{exit(r)}' |