forked from danmar/simplecpp
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.63 KB
/
format.yml
File metadata and controls
62 lines (50 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: format
on:
push:
branches:
- 'master'
- 'releases/**'
- '1.*'
tags:
- '1.*'
pull_request:
permissions:
contents: read
jobs:
format:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -euo pipefail {0}
env:
UNCRUSTIFY_INSTALL_DIR: ${{ github.workspace }}/runformat-uncrustify
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Determine uncrustify version
id: get-uncrustify-version
run: |
version="$(./runformat --expected-uncrustify-version)"
echo "Expected uncrustify version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Set UNCRUSTIFY_VERSION env variable
run: |
version=$(./runformat --expected-uncrustify-version)
echo "version [$version]"
echo "UNCRUSTIFY_VERSION=${version}" >> "$GITHUB_ENV"
- name: Cache uncrustify
uses: actions/cache@v4
id: cache-uncrustify
with:
path: ${{ env.UNCRUSTIFY_INSTALL_DIR }}
key: ${{ runner.os }}-uncrustify-${{ steps.get-uncrustify-version.outputs.version }}
- name: Install uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
run: |
./runformat --install --install-dir "${UNCRUSTIFY_INSTALL_DIR}"
- name: Uncrustify check
run: |
./runformat