Skip to content

Commit 4f89b30

Browse files
authored
Merge pull request #781 from input-output-hk/jpraynaud/777-fix-docker-test-workflow
Fix test Docker image workflow
2 parents 586ebd5 + eb0115d commit 4f89b30

File tree

1 file changed

+17
-37
lines changed

1 file changed

+17
-37
lines changed

.github/workflows/test-docker.yml

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@ on:
66
commit_sha:
77
description: |
88
SHA of the commit on which the mithril binaries should be obtained, a "ci.yml" workflow must have run
9-
on it else no binary would be available leading to the failure of this.
10-
11-
If not provided the last commit on the main branch will be used instead.
12-
required: false
9+
on it otherwise no binary would be available leading to the failure of this workflow.
10+
required: true
1311
type: string
1412
cardano_bin_url:
15-
description: The url of the archive of the Cardano Node/CLI binaries
13+
description: The url of the archive of the Cardano binaries
1614
required: true
1715
type: string
1816
default: https://update-cardano-mainnet.iohk.io/cardano-node-releases/cardano-node-1.35.5-linux.tar.gz
1917
dry_run:
2018
description: Dry run will not push the Docker images to the registry
2119
required: true
2220
type: boolean
23-
default: false
21+
default: true
2422

2523
jobs:
2624
build-push-docker:
@@ -31,8 +29,7 @@ jobs:
3129
project: [ mithril-aggregator, mithril-client, mithril-signer ]
3230

3331
permissions:
34-
contents: read
35-
packages: write
32+
contents: read
3633

3734
env:
3835
REGISTRY: ghcr.io
@@ -42,26 +39,19 @@ jobs:
4239
GITHUB_REF: ${{ github.ref}}
4340

4441
steps:
45-
- name: Prepare environment variables
46-
id: prepare
47-
shell: bash
48-
run: |
49-
if [[ -n "${{ inputs.commit_sha }}" ]]; then
50-
echo "sha=${{ inputs.commit_sha }}" >> $GITHUB_OUTPUT
51-
else
52-
echo "branch=main" >> $GITHUB_OUTPUT
53-
fi
54-
55-
- name: Checkout
42+
- name: Checkout repository
5643
uses: actions/checkout@v3
5744

58-
- name: Checkout binary
45+
- name: Checkout commit
46+
run: |
47+
git checkout ${{ inputs.commit_sha }}
48+
49+
- name: Download built artifacts (Linux-x64)
5950
uses: dawidd6/action-download-artifact@v2
6051
with:
61-
name: mithril-distribution-${{ runner.os }}-${{ runner.arch }}
62-
path: ./bin
63-
commit: ${{ steps.prepare.outputs.sha }}
64-
branch: ${{ steps.prepare.outputs.branch }}
52+
name: mithril-distribution-Linux-X64
53+
path: ${{ matrix.project }}
54+
commit: ${{ inputs.commit_sha }}
6555
workflow: ci.yml
6656
workflow_conclusion: success
6757

@@ -79,23 +69,13 @@ jobs:
7969
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
8070
tags: |
8171
test
82-
type=raw,value=test-${{ github.ref_name }}-{{ steps.prepare.outputs.sha }}
83-
84-
- name: Download built artifacts (Linux-x64)
85-
uses: dawidd6/action-download-artifact@v2
86-
with:
87-
name: mithril-distribution-Linux-X64
88-
path: ${{ matrix.project }}
89-
commit: ${{ steps.prepare.outputs.sha }}
90-
workflow: ci.yml
91-
workflow_conclusion: success
72+
type=raw,value=test-${{ inputs.commit_sha }}
9273
9374
- name: Build and push Docker image
9475
uses: docker/build-push-action@v3
95-
if: ${{ inputs.dry_run }} == 'false'
9676
with:
9777
context: ${{ env.CONTEXT }}
9878
file: ${{ env.DOCKER_FILE }}
99-
build-args: CARDANO_BIN_URL=${{ steps.inputs.cardano_bin_url }}
100-
push: true
79+
build-args: CARDANO_BIN_URL=${{ inputs.cardano_bin_url }}
80+
push: ${{ inputs.dry_run == 'false' }}
10181
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)