Skip to content

Commit abd7d12

Browse files
authored
Unify multiline run statements in GitHub Actions steps (#2272)
1 parent b98e55e commit abd7d12

File tree

5 files changed

+60
-53
lines changed

5 files changed

+60
-53
lines changed

.github/actions/load-image/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ runs:
2222
path: /tmp/jupyter/images/
2323
- name: Load downloaded image to docker 📥
2424
run: |
25-
zstd --uncompress --stdout --rm /tmp/jupyter/images/${{ inputs.image }}-${{ inputs.platform }}-${{ inputs.variant }}.tar.zst | docker load
25+
zstd \
26+
--uncompress \
27+
--stdout \
28+
--rm \
29+
/tmp/jupyter/images/${{ inputs.image }}-${{ inputs.platform }}-${{ inputs.variant }}.tar.zst \
30+
| docker load
2631
docker image ls --all
2732
shell: bash

.github/workflows/docker-build-test-upload.yml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,27 @@ jobs:
6363
shell: bash
6464

6565
- name: Build image 🛠
66-
run: >
67-
docker build
68-
--rm --force-rm
69-
--tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ inputs.image }}
70-
images/${{ inputs.image }}/${{ inputs.variant != 'default' && inputs.variant || '.' }}/
71-
--build-arg REGISTRY=${{ env.REGISTRY }}
72-
--build-arg OWNER=${{ env.OWNER }}
66+
run: |
67+
docker build \
68+
--rm --force-rm \
69+
--tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ inputs.image }} \
70+
images/${{ inputs.image }}/${{ inputs.variant != 'default' && inputs.variant || '.' }}/ \
71+
--build-arg REGISTRY=${{ env.REGISTRY }} \
72+
--build-arg OWNER=${{ env.OWNER }}
7373
env:
7474
DOCKER_BUILDKIT: 1
7575
# Full logs for CI build
7676
BUILDKIT_PROGRESS: plain
7777
shell: bash
7878

7979
- name: Write tags file 🏷
80-
run: >
81-
python3 -m tagging.apps.write_tags_file
82-
--registry ${{ env.REGISTRY }}
83-
--owner ${{ env.OWNER }}
84-
--image ${{ inputs.image }}
85-
--variant ${{ inputs.variant }}
86-
--tags-dir /tmp/jupyter/tags/
80+
run: |
81+
python3 -m tagging.apps.write_tags_file \
82+
--registry ${{ env.REGISTRY }} \
83+
--owner ${{ env.OWNER }} \
84+
--image ${{ inputs.image }} \
85+
--variant ${{ inputs.variant }} \
86+
--tags-dir /tmp/jupyter/tags/
8787
shell: bash
8888
- name: Upload tags file 💾
8989
uses: actions/upload-artifact@v4
@@ -93,15 +93,15 @@ jobs:
9393
retention-days: 3
9494

9595
- name: Write manifest and build history file 🏷
96-
run: >
97-
python3 -m tagging.apps.write_manifest
98-
--registry ${{ env.REGISTRY }}
99-
--owner ${{ env.OWNER }}
100-
--image ${{ inputs.image }}
101-
--variant ${{ inputs.variant }}
102-
--hist-lines-dir /tmp/jupyter/hist_lines/
103-
--manifests-dir /tmp/jupyter/manifests/
104-
--repository ${{ github.repository }}
96+
run: |
97+
python3 -m tagging.apps.write_manifest \
98+
--registry ${{ env.REGISTRY }} \
99+
--owner ${{ env.OWNER }} \
100+
--image ${{ inputs.image }} \
101+
--variant ${{ inputs.variant }} \
102+
--hist-lines-dir /tmp/jupyter/hist_lines/ \
103+
--manifests-dir /tmp/jupyter/manifests/ \
104+
--repository ${{ github.repository }}
105105
shell: bash
106106
- name: Upload manifest file 💾
107107
uses: actions/upload-artifact@v4
@@ -119,7 +119,9 @@ jobs:
119119
- name: Save image as a tar for later use 💾
120120
run: |
121121
mkdir -p /tmp/jupyter/images/
122-
docker save ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ inputs.image }} | zstd > /tmp/jupyter/images/${{ inputs.image }}-${{ inputs.platform }}-${{ inputs.variant }}.tar.zst
122+
docker save \
123+
${{ env.REGISTRY }}/${{ env.OWNER }}/${{ inputs.image }} \
124+
| zstd > /tmp/jupyter/images/${{ inputs.image }}-${{ inputs.platform }}-${{ inputs.variant }}.tar.zst
123125
shell: bash
124126
- name: Upload image as artifact 💾
125127
uses: actions/upload-artifact@v4
@@ -130,9 +132,9 @@ jobs:
130132
compression-level: 0
131133

132134
- name: Run tests ✅
133-
run: >
134-
python3 -m tests.run_tests
135-
--registry ${{ env.REGISTRY }}
136-
--owner ${{ env.OWNER }}
137-
--image ${{ inputs.image }}
135+
run: |
136+
python3 -m tests.run_tests \
137+
--registry ${{ env.REGISTRY }} \
138+
--owner ${{ env.OWNER }} \
139+
--image ${{ inputs.image }}
138140
shell: bash

.github/workflows/docker-tag-push.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ jobs:
6161
name: ${{ inputs.image }}-${{ inputs.platform }}-${{ inputs.variant }}-tags
6262
path: /tmp/jupyter/tags/
6363
- name: Apply tags to the loaded image 🏷
64-
run: >
65-
python3 -m tagging.apps.apply_tags
66-
--registry ${{ env.REGISTRY }}
67-
--owner ${{ env.OWNER }}
68-
--image ${{ inputs.image }}
69-
--variant ${{ inputs.variant }}
70-
--platform ${{ inputs.platform }}
71-
--tags-dir /tmp/jupyter/tags/
64+
run: |
65+
python3 -m tagging.apps.apply_tags \
66+
--registry ${{ env.REGISTRY }} \
67+
--owner ${{ env.OWNER }} \
68+
--image ${{ inputs.image }} \
69+
--variant ${{ inputs.variant }} \
70+
--platform ${{ inputs.platform }} \
71+
--tags-dir /tmp/jupyter/tags/
7272
# This step is needed to prevent pushing non-multi-arch "latest" tag
7373
- name: Remove the "latest" tag from the image 🗑️
7474
run: docker image rmi ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ inputs.image }}:latest

.github/workflows/docker-wiki-update.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
path: wiki_src/
4141

4242
- name: Update wiki 🏷
43-
run: >
44-
python3 -m wiki.update_wiki
45-
--wiki-dir wiki_src/
46-
--hist-lines-dir /tmp/jupyter/hist_lines/
47-
--manifests-dir /tmp/jupyter/manifests/
48-
--repository ${{ github.repository }}
43+
run: |
44+
python3 -m wiki.update_wiki \
45+
--wiki-dir wiki_src/ \
46+
--hist-lines-dir /tmp/jupyter/hist_lines/ \
47+
--manifests-dir /tmp/jupyter/manifests/ \
48+
--repository ${{ github.repository }}
4949
shell: bash
5050

5151
- name: Push Wiki to GitHub 📤

.github/workflows/registry-move.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ jobs:
3333
3434
- name: Login to Quay.io 🔐
3535
if: env.PUSH_TO_REGISTRY == 'true'
36-
run: >
37-
skopeo login quay.io
38-
--username ${{ secrets.QUAY_USERNAME }}
39-
--password ${{ secrets.QUAY_ROBOT_TOKEN }}
36+
run: |
37+
skopeo login quay.io \
38+
--username ${{ secrets.QUAY_USERNAME }} \
39+
--password ${{ secrets.QUAY_ROBOT_TOKEN }}
4040
4141
- name: Move image from Docker Hub to Quay.io 🐳
4242
if: env.PUSH_TO_REGISTRY == 'true'
43-
run: >
44-
skopeo copy
45-
--multi-arch all
46-
docker://${{ env.OWNER }}/${{ matrix.image }}:${{ matrix.tag }}
47-
docker://quay.io/${{ env.OWNER }}/${{ matrix.image }}:${{ matrix.tag }}
43+
run: |
44+
skopeo copy \
45+
--multi-arch all \
46+
docker://${{ env.OWNER }}/${{ matrix.image }}:${{ matrix.tag }} \
47+
docker://quay.io/${{ env.OWNER }}/${{ matrix.image }}:${{ matrix.tag }}
4848
4949
strategy:
5050
fail-fast: false

0 commit comments

Comments
 (0)