Skip to content

Commit 04405cc

Browse files
authored
Merge pull request #68 from simonjbeaumont/sb/conditional-tool-install
Consistently only conditionally install tools in soundness checks
2 parents 56c1f01 + c83fae0 commit 04405cc

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/soundness.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
submodules: true
115115
- name: Run documentation check
116116
run: |
117-
apt-get -qq update && apt-get -qq -y install curl yq
117+
which curl yq || (apt -q update && apt -yq install curl yq)
118118
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/check-docs.sh | bash
119119
120120
unacceptable-language-check:
@@ -181,7 +181,7 @@ jobs:
181181
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
182182
- name: Run format check
183183
run: |
184-
apt-get -qq update && apt-get -qq -y install curl
184+
which curl || (apt -q update && apt -yq install curl)
185185
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/check-swift-format.sh | bash
186186
187187
shell-check:
@@ -202,7 +202,7 @@ jobs:
202202
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
203203
- name: Run shellcheck
204204
run: |
205-
apt-get -qq update && apt-get -qq -y install shellcheck
205+
which shellcheck || (apt -q update && apt -yq install shellcheck)
206206
git ls-files -z '*.sh' | xargs -0 --no-run-if-empty shellcheck
207207
208208
yaml-lint-check:
@@ -218,7 +218,7 @@ jobs:
218218
submodules: true
219219
- name: Run yamllint
220220
run: |
221-
which yamllint >/dev/null || ( apt-get update && apt-get install -y yamllint )
221+
which yamllint || (apt -q update && apt install -yq yamllint)
222222
cd ${GITHUB_WORKSPACE}
223223
if [ ! -f ".yamllint.yml" ]; then
224224
echo "Downloading default yamllint config file"

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]"
6565
```
6666

6767
Additionally, if your package requires additional installed packages, you can
68-
use the `pre_build_command`:
68+
use the `pre_build_command`. For example, to install a package called
69+
`example`:
6970

7071
```yaml
71-
pre_build_command: "apt-get update -y -q && apt-get install -y -q example"
72+
pre_build_command: "which example || (apt update -q && apt install -yq example"
7273
```
7374

7475
macOS and Windows platform support will be available soon.

0 commit comments

Comments
 (0)