Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(IDX): k8s system tests workflow #498

Merged
merged 24 commits into from
Jul 23, 2024
80 changes: 80 additions & 0 deletions .github/workflows/system-tests-k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Sytem Tests K8s

# Run specific system test:
# gh workflow run system-tests-k8s.yml \
# --ref marko-system-tests-k8s \
# --field targets="//rs/tests/testing_verification:basic_health_test" \
# --field jobs="32"

on:
pull_request:
paths:
- '.github/workflows/system-tests-k8s.yml'
workflow_dispatch:
inputs:
targets:
description: 'System Tests / Bazel Targets'
required: false
default: '//rs/tests/testing_verification:basic_health_test'
jobs:
description: 'Concurrent Bazel Jobs'
required: false
default: '32'

env:
TARGETS: "${{ github.event.inputs.targets || '//rs/tests/testing_verification:basic_health_test' }}"
JOBS: "${{ github.event.inputs.jobs || '32' }}"
AWS_SHARED_CREDENTIALS_CONTENT: ${{ secrets.AWS_SHARED_CREDENTIALS_FILE }}
BAZEL_STARTUP_ARGS: "--output_base=/var/tmp/bazel-output/"
CI_COMMIT_SHA: ${{ github.sha }}
CI_COMMIT_REF_PROTECTED: ${{ github.ref_protected }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_ID: ${{ github.job }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
ROOT_PIPELINE_ID: ${{ github.run_id }}
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASSWORD_RO: ${{ secrets.DOCKER_HUB_PASSWORD_RO }}
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }}
BUILDEVENT_DATASET: "github-ci-dfinity"

jobs:
bazel-system-tests-k8s:
name: Bazel System Tests K8s
runs-on:
group: ln1
labels: dind-large
container:
image: ghcr.io/dfinity/ic-build@sha256:26cc347efa50935342742acddfb5d710fae1982d401911013ad8750f0603c590
options: >-
-e NODE_NAME -e KUBECONFIG
--privileged --cgroupns host
-v /cache:/cache -v /var/sysimage:/var/sysimage -v /var/tmp:/var/tmp
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Before script
id: before-script
shell: bash
run: ./gitlab-ci/src/ci-scripts/before-script.sh

- name: Set KUBECONFIG
shell: bash
run: |
echo "$TNET_KUBECONFIG" > /tmp/kubeconfig
echo "KUBECONFIG=/tmp/kubeconfig" >> $GITHUB_ENV
env:
TNET_KUBECONFIG: ${{ secrets.TNET_KUBECONFIG }}

- name: Run System Tests on K8s
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "${{ env.TARGETS }}"
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel"
BAZEL_EXTRA_ARGS: "--jobs=${{ env.JOBS }} --test_tag_filters=k8s,-manual --k8s"
HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }}