Skip to content

Commit c83fae0

Browse files
Consistently only conditionally install tools in soundness checks
1 parent 3fca720 commit c83fae0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/soundness.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
submodules: true
107107
- name: Run documentation check
108108
run: |
109-
apt-get -qq update && apt-get -qq -y install curl yq
109+
which curl yq || (apt -q update && apt -yq install curl yq)
110110
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/check-docs.sh | bash
111111
112112
unacceptable-language-check:
@@ -173,7 +173,7 @@ jobs:
173173
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
174174
- name: Run format check
175175
run: |
176-
apt-get -qq update && apt-get -qq -y install curl
176+
which curl || (apt -q update && apt -yq install curl)
177177
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/check-swift-format.sh | bash
178178
179179
shell-check:
@@ -194,7 +194,7 @@ jobs:
194194
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
195195
- name: Run shellcheck
196196
run: |
197-
apt-get -qq update && apt-get -qq -y install shellcheck
197+
which shellcheck || (apt -q update && apt -yq install shellcheck)
198198
git ls-files -z '*.sh' | xargs -0 --no-run-if-empty shellcheck
199199
200200
yaml-lint-check:
@@ -210,7 +210,7 @@ jobs:
210210
submodules: true
211211
- name: Run yamllint
212212
run: |
213-
which yamllint >/dev/null || ( apt-get update && apt-get install -y yamllint )
213+
which yamllint || (apt -q update && apt install -yq yamllint)
214214
cd ${GITHUB_WORKSPACE}
215215
if [ ! -f ".yamllint.yml" ]; then
216216
echo "Downloading default yamllint config file"

README.md

Lines changed: 3 additions & 2 deletions
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)