|
12 | 12 | docker:
|
13 | 13 | strategy:
|
14 | 14 | matrix:
|
15 |
| - docker_image: [emerald-localnet, sapphire-localnet] |
| 15 | + docker_image: [sapphire-localnet] |
16 | 16 | runs-on: ubuntu-latest
|
17 | 17 | steps:
|
18 | 18 | - name: Checkout code
|
|
24 | 24 | - name: Set up Docker Buildx
|
25 | 25 | uses: docker/setup-buildx-action@v3
|
26 | 26 |
|
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 |
| - |
34 | 27 | - name: Compute version
|
35 | 28 | # Version docker image by date and git revision.
|
36 | 29 | run: |
|
|
52 | 45 | working-directory: docker/${{ matrix.docker_image }}
|
53 | 46 | run: ./test.sh
|
54 | 47 |
|
| 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 | + |
55 | 57 | - name: Push
|
56 |
| - if: ${{ github.event_name == 'push' }} |
| 58 | + if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' }} |
57 | 59 | uses: docker/build-push-action@v6
|
58 | 60 | with:
|
59 | 61 | build-args: |
|
|
69 | 71 | org.opencontainers.image.revision=${{ github.sha }}
|
70 | 72 |
|
71 | 73 | - 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' }} |
73 | 75 |
|
74 | 76 | with:
|
75 | 77 | token: ${{ secrets.GITHUB_TOKEN }}
|
|
79 | 81 | keep-last: 2
|
80 | 82 | prune-untagged: true
|
81 | 83 | 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: Setup Docker |
| 105 | + run: | |
| 106 | + brew install docker colima qemu |
| 107 | +
|
| 108 | + - name: Start Colima |
| 109 | + run: colima start --network-address --arch arm64 --vm-type=qemu |
| 110 | + |
| 111 | + - name: Load image |
| 112 | + run: | |
| 113 | + docker load --input /tmp/${{ matrix.docker_image }}.tar |
| 114 | + docker image ls -a |
| 115 | +
|
| 116 | + - name: Test |
| 117 | + timeout-minutes: 3 |
| 118 | + working-directory: docker/sapphire-localnet |
| 119 | + run: ./test.sh |
0 commit comments