Skip to content

Docker - Dist-Tests #130

Docker - Dist-Tests

Docker - Dist-Tests #130

name: Docker - Dist-Tests
on:
push:
branches:
- main
tags:
- 'v*.*.*'
paths-ignore:
- '**/*.md'
- '.gitignore'
- '.github/**'
- '!.github/workflows/docker-dist-tests.yml'
- '!.github/workflows/docker-reusable.yml'
- '!.github/workflows/deploy-on-network.yml'
- 'docker/**'
- '!docker/archivist.Dockerfile'
- '!docker/docker-entrypoint.sh'
workflow_dispatch:
inputs:
run_release_tests:
description: Run Release tests
required: false
type: boolean
default: false
deploy_devnet:
description: Deploy Devnet
required: false
type: boolean
default: false
jobs:
get-contracts-hash:
runs-on: ubuntu-latest
outputs:
hash: ${{ steps.get-hash.outputs.hash }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Get submodule short hash
id: get-hash
run: |
hash=$(git rev-parse --short HEAD:vendor/archivist-contracts)
echo "hash=$hash" >> $GITHUB_OUTPUT
build-and-push:
name: Build and Push
uses: ./.github/workflows/docker-reusable.yml
needs: get-contracts-hash
with:
nimflags: '-d:release -d:disableMarchNative -d:nimleopard_portable_build -d:archivist_system_testing_options -d:verify_circuit=true'
nat_ip_auto: true
tag_latest: ${{ github.ref_name == github.event.repository.default_branch || startsWith(github.ref, 'refs/tags/') }}
tag_suffix: dist-tests
tag_stable: ${{ startsWith(github.ref, 'refs/tags/') }}
contract_image: "durabilitylabs/archivist-contracts:sha-${{ needs.get-contracts-hash.outputs.hash }}-dist-tests"
run_release_tests: ${{ inputs.run_release_tests }}
secrets: inherit
deploy-testnet:
name: Deploy Testnet
uses: ./.github/workflows/deploy-on-network.yml
needs: build-and-push
if: github.ref_type == 'tag'
with:
network: testnet
archivist_image: ${{ needs.build-and-push.outputs.archivist_image }}
secrets: inherit
deploy-devnet:
name: Deploy Devnet
uses: ./.github/workflows/deploy-on-network.yml
needs: [build-and-push, deploy-testnet]
if: ${{ !(failure() || cancelled()) && (inputs.deploy_devnet || github.event_name == 'push' && github.ref_name == github.event.repository.default_branch) }}
with:
network: devnet
archivist_image: ${{ needs.build-and-push.outputs.archivist_image }}
secrets: inherit