Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: Build and test localnet on macOS #677

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 44 additions & 10 deletions .github/workflows/docker-localnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
docker:
strategy:
matrix:
docker_image: [emerald-localnet, sapphire-localnet]
docker_image: [sapphire-localnet]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -24,13 +24,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compute version
# Version docker image by date and git revision.
run: |
Expand All @@ -52,8 +45,17 @@ jobs:
working-directory: docker/${{ matrix.docker_image }}
run: ./test.sh

- name: Export
run: docker save ghcr.io/oasisprotocol/${{ matrix.docker_image }}:local --output /tmp/${{ matrix.docker_image }}.tar

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.docker_image }}
path: /tmp/${{ matrix.docker_image }}.tar

- name: Push
if: ${{ github.event_name == 'push' }}
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' }}
uses: docker/build-push-action@v6
with:
build-args: |
Expand All @@ -69,7 +71,7 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}

- name: Prune old ghcr.io/oasisprotocol/${{ matrix.docker_image }} images
if: ${{ github.event_name == 'push' }}
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' }}
uses: vlaurin/action-ghcr-prune@v0.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -79,3 +81,35 @@ jobs:
keep-last: 2
prune-untagged: true
prune-tags-regexes: ^latest-

mac:
needs: docker
strategy:
matrix:
docker_image: [sapphire-localnet]
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# We need history to determine oasis-web3-gateway version from git tag.
fetch-depth: 0

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.docker_image }}
path: /tmp

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Load image
run: |
docker load --input /tmp/${{ matrix.docker_image }}.tar
docker image ls -a

- name: Test
timeout-minutes: 3
working-directory: docker/sapphire-localnet
run: ./test.sh
Loading