Skip to content

Commit 0cdc470

Browse files
committed
other: Build and test localnet on macos
1 parent 2f9d783 commit 0cdc470

File tree

1 file changed

+44
-10
lines changed

1 file changed

+44
-10
lines changed

.github/workflows/docker-localnet.yml

+44-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
docker:
1313
strategy:
1414
matrix:
15-
docker_image: [emerald-localnet, sapphire-localnet]
15+
docker_image: [sapphire-localnet]
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout code
@@ -24,13 +24,6 @@ jobs:
2424
- name: Set up Docker Buildx
2525
uses: docker/setup-buildx-action@v3
2626

27-
- name: Login to ghcr.io
28-
uses: docker/login-action@v3
29-
with:
30-
registry: ghcr.io
31-
username: ${{ github.actor }}
32-
password: ${{ secrets.GITHUB_TOKEN }}
33-
3427
- name: Compute version
3528
# Version docker image by date and git revision.
3629
run: |
@@ -52,8 +45,17 @@ jobs:
5245
working-directory: docker/${{ matrix.docker_image }}
5346
run: ./test.sh
5447

48+
- name: Export
49+
run: docker save ghcr.io/oasisprotocol/${{ matrix.docker_image }}:local --output /tmp/${{ matrix.docker_image }}.tar
50+
51+
- name: Upload artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: ${{ matrix.docker_image }}
55+
path: /tmp/${{ matrix.docker_image }}.tar
56+
5557
- name: Push
56-
if: ${{ github.event_name == 'push' }}
58+
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' }}
5759
uses: docker/build-push-action@v6
5860
with:
5961
build-args: |
@@ -69,7 +71,7 @@ jobs:
6971
org.opencontainers.image.revision=${{ github.sha }}
7072
7173
- name: Prune old ghcr.io/oasisprotocol/${{ matrix.docker_image }} images
72-
if: ${{ github.event_name == 'push' }}
74+
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' }}
7375
uses: vlaurin/[email protected]
7476
with:
7577
token: ${{ secrets.GITHUB_TOKEN }}
@@ -79,3 +81,35 @@ jobs:
7981
keep-last: 2
8082
prune-untagged: true
8183
prune-tags-regexes: ^latest-
84+
85+
mac:
86+
needs: docker
87+
strategy:
88+
matrix:
89+
docker_image: [sapphire-localnet]
90+
runs-on: macos-latest
91+
steps:
92+
- name: Checkout code
93+
uses: actions/checkout@v4
94+
with:
95+
# We need history to determine oasis-web3-gateway version from git tag.
96+
fetch-depth: 0
97+
98+
- name: Download artifact
99+
uses: actions/download-artifact@v4
100+
with:
101+
name: ${{ matrix.docker_image }}
102+
path: /tmp
103+
104+
- name: Set up QEMU
105+
uses: docker/setup-qemu-action@v3
106+
107+
- name: Load image
108+
run: |
109+
docker load --input /tmp/${{ matrix.docker_image }}.tar
110+
docker image ls -a
111+
112+
- name: Test
113+
timeout-minutes: 3
114+
working-directory: docker/sapphire-localnet
115+
run: ./test.sh

0 commit comments

Comments
 (0)