Skip to content

[WIP] Move CI from Gitlab to GitHub #21

[WIP] Move CI from Gitlab to GitHub

[WIP] Move CI from Gitlab to GitHub #21

name: Zombienet Integration Tests
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: {}
env:
IMAGE_NAME: paritypr/zombienet
VERSION: ${{ github.sha }}
jobs:
build_image:
name: Build image
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out the repo
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0
- name: npm build
run: |
cd javascript
npm install
npm dedupe
npm run clean
npm run build
- name: Build Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
file: ./scripts/ci/docker/zombienet_injected.Dockerfile
context: .
push: false
tags: |
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
${{ env.IMAGE_NAME }}:latest
build_push_image:
name: Build and Push Docker image to Docker Hub
runs-on: ubuntu-latest
timeout-minutes: 30
needs: [build_image]
steps:
- name: Check out the repo
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0
- name: npm build
run: |
cd javascript
npm install
npm dedupe
npm run clean
npm run build
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Build Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
file: ./scripts/ci/docker/zombienet_injected.Dockerfile
context: .
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
${{ env.IMAGE_NAME }}:latest
# example job
# zombienet-smoke:
# name: Zombienet Smoke Tests
# runs-on: zombienet-polkadot-integration-test
# timeout-minutes: 30
# container:
# image: ${{ env.IMAGE_NAME }}:${{ env.VERSION }}
# needs: [build_push_image]
# env:
# LOCAL_DIR: "/builds/parity/mirrors/zombienet/tests"
# FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1
# steps:
# - name: Check out the repo
# uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v.4.2.0
# - name: smoke test
# run: |
# echo "Zombienet Tests Config"
# echo "${ZOMBIENET_IMAGE}"
# echo "${GH_DIR}"
# echo "${LOCAL_DIR}"
# export DEBUG=zombie
# export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master"
# export COL_IMAGE="docker.io/paritypr/colander:master"
# TODO: add script to get latest from dockerhub
# export CUMULUS_TEST_IMAGE="docker.io/paritypr/test-parachain:c90f9713b5bc73a9620b2e72b226b4d11e018190"
# echo "relay_image ${ZOMBIENET_INTEGRATION_TEST_IMAGE}"
# echo "col_image ${COL_IMAGE}"
# /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh --local-dir="${LOCAL_DIR}" --test="0001-smoke.zndsl"