File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 cc : gcc
2727 cxx : g++
2828 shell : sh
29+ - os : ubuntu-latest
30+ type : container
31+ container : alpine:3.21
32+ cc : gcc
33+ cxx : g++
34+ shell : sh
2935 - os : macos-15-intel
3036 type : native
3137 cc : clang
4854 shell : ${{ matrix.platform.shell }}
4955
5056 runs-on : ${{ matrix.platform.os }}
57+ container : ${{ matrix.platform.container }}
5158 env :
5259 CC : ${{ matrix.platform.cc }}
5360 CXX : ${{ matrix.platform.cxx }}
6067 additional-packages : cmake build-essential shellcheck pipx zsh jq
6168 wsl-version : 2
6269
70+ - name : Install dependencies (Alpine)
71+ if : matrix.platform.type == 'container'
72+ run : apk add --no-cache cmake make g++ zsh bash jq shellcheck pipx git
73+
6374 - name : Install pre-commit
6475 run : pipx install pre-commit
6576 - name : Surface pipx binaries to WSL
7889 if : runner.os == 'windows' && matrix.platform.type == 'native'
7990 run : choco install shellcheck
8091 - name : Install dependencies (Linux)
81- if : runner.os == 'linux'
92+ if : runner.os == 'linux' && matrix.platform.type == 'native'
8293 run : sudo apt-get update --yes && sudo apt-get install --yes zsh
8394
8495 - run : cmake --version
93104 -DBUILD_SHARED_LIBS:BOOL=OFF
94105 -DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON
95106 - run : cmake --build ./build --config Release --target clang_format_test
107+ # TODO: As the downloaded `clang-format` binary won't run on Alpine
108+ if : matrix.platform.type != 'container'
96109 - run : cmake --build ./build --config Release --target shellcheck
97110 - run : cmake --build ./build --config Release --parallel 4
98111 - run : >
Original file line number Diff line number Diff line change 33set -o errexit
44set -o nounset
55
6+ # Ensure pipx-installed binaries are in PATH
7+ export PATH=" $HOME /.local/bin:$PATH "
8+
69TMP=" $( mktemp -d) "
710clean () { rm -rf " $TMP " ; }
811trap clean EXIT
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ TMP="$(mktemp -d)"
77clean () { rm -rf " $TMP " ; }
88trap clean EXIT
99
10- mkdir -p " $TMP /this/is/a/very/very/very/long/path"
10+ mkdir -p " $TMP /this/is/a/very/very/very/very/very/very/ long/path"
1111
12- cat << 'EOF ' > "$TMP/this/is/a/very/very/very/long/path/schema.json"
12+ cat << 'EOF ' > "$TMP/this/is/a/very/very/very/very/very/very/ long/path/schema.json"
1313{
1414 "type": "string",
1515 "$schema": "http://json-schema.org/draft-04/schema#",
@@ -18,15 +18,15 @@ cat << 'EOF' > "$TMP/this/is/a/very/very/very/long/path/schema.json"
1818}
1919EOF
2020
21- " $1 " fmt " $TMP /this/is/a/very/very/very/long/path/schema.json" \
21+ " $1 " fmt " $TMP /this/is/a/very/very/very/very/very/very/ long/path/schema.json" \
2222 --check --json > " $TMP /output.json" 2>&1 && CODE=" $? " || CODE=" $? "
2323test " $CODE " = " 2" || exit 1
2424
2525cat << EOF > "$TMP /expected.json"
2626{
2727 "valid": false,
2828 "errors": [
29- "$( realpath " $TMP " ) /this/is/a/very/very/very/long/path/schema.json"
29+ "$( realpath " $TMP " ) /this/is/a/very/very/very/very/very/very/ long/path/schema.json"
3030 ]
3131}
3232EOF
You can’t perform that action at this time.
0 commit comments