Skip to content

Commit

Permalink
[WIP] Move CI from Gitlab to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
alvicsam committed Oct 2, 2024
1 parent 76cbcb4 commit ddc3a6f
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 32 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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: Check that the image can be build
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Build and push Docker image from main
uses: docker/build-push-action@v5
with:
context: .
file: ./scripts/ci/docker/zombienet_injected.Dockerfile
push: false
tags: |
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
${{ env.IMAGE_NAME }}:latest
build_push_image:
name: 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@v4

# - name: Log in to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USER }}
# password: ${{ secrets.DOCKERHUB_PASS }}

# - name: Build and push Docker image from main
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ./Dockerfile
# push: true
# tags: |
# ${{ env.IMAGE_NAME }}:${{ env.VERSION }}
# ${{ env.IMAGE_NAME }}:latest
41 changes: 9 additions & 32 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ stages:
- publish
- zombienet


variables:
CI_IMAGE: "node:18"
DOCKERFILE: scripts/ci/docker/zombienet_injected.Dockerfile
Expand All @@ -31,13 +30,13 @@ variables:
cache:
- key:
files:
- javascript/package-lock.json
- javascript/package-lock.json
- paths:
- javascript/packages/cli/dist
- javascript/packages/orchestrator/dist
- javascript/packages/utils/dist
- javascript/package.json
- javascript/package-lock.json
- javascript/packages/cli/dist
- javascript/packages/orchestrator/dist
- javascript/packages/utils/dist
- javascript/package.json
- javascript/package-lock.json

.kubernetes-env: &kubernetes-env
image: $CI_IMAGE
Expand All @@ -51,9 +50,9 @@ cache:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- changes:
- javascript/**/*
- tests/**/*
- crates/**/*
- javascript/**/*
- tests/**/*
- crates/**/*

# run jobs always
.common-refs: &common-refs
Expand All @@ -72,26 +71,6 @@ cache:
- if: $CI_COMMIT_REF_NAME == "main"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1

test:
stage: test
<<: *kubernetes-env
<<: *common-refs
script:
- cd javascript
- npm install
# - npm run test
- echo testme

build:
stage: build
<<: *kubernetes-env
<<: *common-refs
script:
- cd javascript
- npm install
- npm run clean
- npm run build

# template task for building and pushing an image
.build-push-docker-image: &build-push-docker-image
script:
Expand Down Expand Up @@ -174,7 +153,6 @@ publish-docker-image-description:
script:
- cd / && sh entrypoint.sh


.zombienet-common:
before_script:
- echo "Zombienet Tests Config"
Expand Down Expand Up @@ -287,4 +265,3 @@ chaos-delay:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}"
--test="0001-delay.zndsl"

0 comments on commit ddc3a6f

Please sign in to comment.