Merge branch 'main' into test-container-startup #90
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| - push | |
| env: | |
| TARGET: ${{ github.ref == 'refs/heads/main' && 'wallet-gateway' || 'wallet-gateway-unstable' }} | |
| defaults: | |
| run: | |
| shell: nix-shell --run "exec bash -euo pipefail {0}" | |
| jobs: | |
| check: | |
| runs-on: digital-asset-wallet-gateway | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Check schema | |
| run: | | |
| make generate | |
| out="$(git status --porcelain)" | |
| if [ ! -z "${out}" ]; then | |
| echo "Helm schema needs to be re-generated, please run 'make generate'" | |
| echo "${out}" | |
| exit 1 | |
| fi | |
| echo "No changes" | |
| - name: Helm unittests | |
| run: make test | |
| docker-build-and-publish: | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Get Version | |
| id: version | |
| run: echo "version=$(<VERSION)" | tee -a "${GITHUB_OUTPUT}" | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and export to Docker | |
| uses: docker/build-push-action@v6 | |
| with: | |
| build-args: version=${{ steps.version.outputs.version }} | |
| load: true | |
| tags: ${{ env.TARGET }}-test | |
| - name: Test | |
| run: | | |
| npx --yes @canton-network/wallet-gateway-remote@${{ steps.version.outputs.version }} --config-example > config.json | |
| docker run -p 3030:3030 -v ./config.json:/app/config.json ${{ env.TARGET }}-test & | |
| sleep 5 | |
| output=$(curl --silent --show-error --fail http://localhost:3030/login) | |
| expected=$(cat <<EOF | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Redirecting</title> | |
| </head> | |
| <body> | |
| <pre>Redirecting to /login/</pre> | |
| </body> | |
| </html> | |
| EOF | |
| ) | |
| if [ "$output" != "$expected" ]; then | |
| echo "Unexpected response from wallet-gateway:" | |
| echo "$output" | |
| exit 1 | |
| fi | |
| - name: Docker Build and Publish | |
| uses: docker/build-push-action@v6 | |
| with: | |
| build-args: version=${{ steps.version.outputs.version }} | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ghcr.io/digital-asset/${{ env.TARGET }}/docker/wallet-gateway:v${{ steps.version.outputs.version }} | |
| helm-publish: | |
| runs-on: digital-asset-wallet-gateway | |
| permissions: | |
| contents: read | |
| packages: write | |
| needs: | |
| - check | |
| - docker-build-and-publish | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Get Version | |
| id: version | |
| run: echo "version=$(<VERSION)" | tee -a "${GITHUB_OUTPUT}" | |
| - name: Helm package | |
| run: make package | |
| - name: Archive helm package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: helm package | |
| path: target/wallet-gateway-${{ steps.version.outputs.version }}.tgz | |
| - name: Helm push | |
| run: helm push --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} target/wallet-gateway-${{ steps.version.outputs.version }}.tgz oci://ghcr.io/digital-asset/${{ env.TARGET }}/helm |