Skip to content

Commit 1160c3a

Browse files
committed
test: get nitro docker image from ghcr
1 parent 0602080 commit 1160c3a

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

.github/workflows/build-test.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,46 @@ jobs:
269269
tags: |
270270
${{ env.INT_TEST_CONTRACTS_IMAGE }}
271271
272+
publish-nitro-image:
273+
name: Publish Nitro Image
274+
runs-on: ubuntu-latest
275+
permissions:
276+
contents: read
277+
packages: write
278+
steps:
279+
- name: Set Nitro image
280+
run: |
281+
echo "NITRO_SOURCE_IMAGE=offchainlabs/nitro-node:v3.9.5-66e42c4" >> "$GITHUB_ENV"
282+
echo "NITRO_IMAGE=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/nitro-node:v3.9.5-66e42c4" >> "$GITHUB_ENV"
283+
284+
- name: Set up Docker Buildx
285+
uses: docker/setup-buildx-action@v3
286+
287+
- name: Log in to GHCR
288+
uses: docker/login-action@v3
289+
with:
290+
registry: ghcr.io
291+
username: ${{ github.actor }}
292+
password: ${{ secrets.GITHUB_TOKEN }}
293+
294+
- name: Check Nitro image
295+
id: check-image
296+
run: |
297+
if docker manifest inspect "${NITRO_IMAGE}" >/dev/null 2>&1; then
298+
echo "exists=true" >> "$GITHUB_OUTPUT"
299+
else
300+
echo "exists=false" >> "$GITHUB_OUTPUT"
301+
fi
302+
303+
- name: Mirror Nitro image to GHCR
304+
if: steps.check-image.outputs.exists != 'true'
305+
run: docker buildx imagetools create --tag "${NITRO_IMAGE}" "${NITRO_SOURCE_IMAGE}"
306+
272307
test-integration-anvil:
273308
name: Test (Integration Anvil)
274309
needs:
275310
- publish-int-test-contracts-image
311+
- publish-nitro-image
276312
runs-on: ubuntu-latest
277313
permissions:
278314
contents: read
@@ -285,7 +321,7 @@ jobs:
285321
run: |
286322
echo "INT_TEST_CONTRACTS_IMAGE=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/chain-sdk-int-test-contracts:v3.2.0-2f747c7-v1.2.5-5975d8f73608" >> "$GITHUB_ENV"
287323
echo "ANVIL_IMAGE=ghcr.io/foundry-rs/foundry:v1.3.1" >> "$GITHUB_ENV"
288-
echo "NITRO_IMAGE=offchainlabs/nitro-node:v3.9.5-66e42c4" >> "$GITHUB_ENV"
324+
echo "NITRO_IMAGE=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/nitro-node:v3.9.5-66e42c4" >> "$GITHUB_ENV"
289325
290326
- name: Log in to GHCR
291327
uses: docker/login-action@v3

src/integrationTestHelpers/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ethers } from 'ethers';
33

44
export const testConstants = {
55
ANVIL_IMAGE: 'ghcr.io/foundry-rs/foundry:v1.3.1',
6-
NITRO_IMAGE: 'offchainlabs/nitro-node:v3.9.5-66e42c4',
6+
NITRO_IMAGE: 'ghcr.io/offchainlabs/nitro-node:v3.9.5-66e42c4',
77
INT_TEST_CONTRACTS_IMAGE:
88
'ghcr.io/offchainlabs/chain-sdk-int-test-contracts:v3.2.0-2f747c7-v1.2.5-5975d8f73608',
99
DEPLOYER_PRIVATE_KEY: '0x490d84b7602e4b470af4f86a3ad095607a8bb5a4fa8ba148f41fcfd236b4fdf5' as Hex,

0 commit comments

Comments
 (0)