Skip to content

Commit

Permalink
Ci/zombie tests ci update (#2116)
Browse files Browse the repository at this point in the history
* zombie tests ci integration for master
---------

Co-authored-by: Kirill Azovtsev <[email protected]>
Co-authored-by: kamilsa <[email protected]>
  • Loading branch information
3 people authored May 31, 2024
1 parent 649ea5e commit fa9dc44
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 26 deletions.
88 changes: 62 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
env:
KAGOME_IN_DOCKER: 0
KAGOME_MAC_CI: 1


Linux:
if: ${{ !(github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/' )) }}
strategy:
Expand All @@ -56,7 +58,6 @@ jobs:
options:
- name: "Linux: clang-16 External Project"
run: ./housekeeping/make_external_build.sh -DCLEAR_OBJS=ON -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchain/clang-16_cxx20.cmake

name: "${{ matrix.options.name }}"
runs-on: ubuntu-latest
timeout-minutes: 120
Expand Down Expand Up @@ -215,7 +216,7 @@ jobs:
BUILD_TYPE: "${{ matrix.options.build-type }}"
run: ./housekeeping/docker/kagome-dev/make.sh

Push-self-hosted:
push-self-hosted:
if: ${{ github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/' ) }}
needs: [clang-tidy, MacOS, Minideb-self-hosted]
strategy:
Expand Down Expand Up @@ -249,13 +250,59 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: docker pack and push
id: docker-pack-and-push
env:
VERSION: ${{ github.ref }}
BUILD_TYPE: "${{ matrix.options.build-type }}"
run: ./housekeeping/docker/kagome/build_and_push.sh
run: |
./housekeeping/docker/kagome/build_and_push.sh
- name: Save TAG
id: save-tag
if: matrix.options.build-type == 'Release'
run: TAG=$(cat tag_output.txt) && echo "tag=$TAG" >> $GITHUB_OUTPUT
outputs:
release-tag: ${{ steps.save-tag.outputs.tag }}

zombie-tests:
if: true
Prepare-Zombie-Tests-Docker:
runs-on: [ actions-runner-controller ]
timeout-minutes: 60
needs: [push-self-hosted]
steps:
- uses: azure/docker-login@83efeb77770c98b620c73055fbb59b2847e17dc0
with:
login-server: https://index.docker.io/v1/
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Pull Kagome Docker Image
run: docker pull ${{ needs.push-self-hosted.outputs.release-tag }}
- name: Load image
run: docker image ls -a
- name: Set owner of working dir recursively
run: sudo chown -R $(whoami) .
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
- name: Extract branch name
shell: bash
run: |
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "branch=${branch}" >> $GITHUB_OUTPUT
echo "Branch name: ${branch}"
id: extract_branch
- name: Build zombie-tester
working-directory: ./zombienet/docker
run: make tester BRANCH_NAME=${{ steps.extract_branch.outputs.branch }} KAGOME_IMAGE=${{ needs.push-self-hosted.outputs.release-tag }}
- name: Archive zombie-tester
shell: bash
run: docker save -o /tmp/zombie-tester.tar zombie-tester:latest
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: zombie-tester
path: /tmp/zombie-tester.tar

Zombie-Tests:
runs-on: [ actions-runner-controller ]
timeout-minutes: 60
needs: [Prepare-Zombie-Tests-Docker]
strategy:
fail-fast: false
matrix:
Expand All @@ -282,28 +329,17 @@ jobs:
test: "test-polkadot-functional-0010-validator-disabling"
- name: "Test we are producing blocks at 6 seconds clip"
test: "test-polkadot-functional-0011-async-backing-6-seconds-rate"
runs-on: [ actions-runner-controller ]
timeout-minutes: 120
env:
BRANCH_NAME: ${{ github.head_ref }}
needs: [Push-self-hosted]
steps:
- name: Set owner of working dir recurively
run: sudo chown -R $(whoami) .
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: zombie-tester
path: /tmp
- name: Load image
run: |
docker load --input /tmp/zombie-tester.tar
docker image ls -a
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
- name: build zombie-tester
working-directory: ./zombienet/docker
run: make tester BRANCH_NAME=${{ env.BRANCH_NAME }}
- name: Run test
working-directory: ./zombienet/docker
run: make ${{ matrix.options.test }}

# Trigger_CD:
# if: ${{ github.ref == 'refs/heads/master' }}
# needs: [Push-self-hosted]
# runs-on: ubuntu-latest
# steps:
# - name: trigger cd job
# run: |
# curl -fI "${{ secrets.JENKINS_URL }}kagome-test&token=${{ secrets.JENKINS_TOKEN }}"
# curl -fI "${{ secrets.JENKINS_URL }}polkadot-test&token=${{ secrets.JENKINS_TOKEN }}"
run: make ${{ matrix.options.test }} ZOMBIE_TESTER_IMAGE=zombie-tester:latest
2 changes: 2 additions & 0 deletions housekeeping/docker/kagome/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ if [ "$BUILD_TYPE" = "RelWithDebInfo" ]; then
TAG_HASH_COMMIT="${TAG_HASH_COMMIT}-rel-with-deb-info"
fi

echo "$TAG_HASH_COMMIT" > tag_output.txt

docker tag $TAG $TAG_HASH_COMMIT
docker push $TAG_HASH_COMMIT

Expand Down

0 comments on commit fa9dc44

Please sign in to comment.