diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 000000000..af47c5e0b --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -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 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b5c9eddb1..e0708279e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,6 @@ stages: - publish - zombienet - variables: CI_IMAGE: "node:18" DOCKERFILE: scripts/ci/docker/zombienet_injected.Dockerfile @@ -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 @@ -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 @@ -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: @@ -174,7 +153,6 @@ publish-docker-image-description: script: - cd / && sh entrypoint.sh - .zombienet-common: before_script: - echo "Zombienet Tests Config" @@ -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" -