From f0545396dfe4b5620d7cde3bbadf7c9c36106ac3 Mon Sep 17 00:00:00 2001 From: Kirill Sibirev Date: Fri, 8 Dec 2023 18:06:29 +0100 Subject: [PATCH 1/2] Run tests for PRs --- .github/workflows/check-pr.yaml | 103 ++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .github/workflows/check-pr.yaml diff --git a/.github/workflows/check-pr.yaml b/.github/workflows/check-pr.yaml new file mode 100644 index 00000000..b4811732 --- /dev/null +++ b/.github/workflows/check-pr.yaml @@ -0,0 +1,103 @@ +name: Build and test + +on: + pull_request: + +jobs: + start-vm: + if: github.event.pull_request.head.repo.full_name == github.repository + name: Start VM + runs-on: ubuntu-latest + outputs: + label: ${{ steps.start-yc-runner.outputs.label }} + instance-id: ${{ steps.start-yc-runner.outputs.instance-id }} + steps: + - name: Start YC runner + id: start-yc-runner + uses: yc-actions/yc-github-runner@v1 + with: + mode: start + yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }} + github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + folder-id: ${{ vars.YC_FOLDER_ID }} + image-id: ${{ vars.YC_DEFAULT_IMAGE_ID }} + zone-id: ${{ vars.YC_ZONE_ID }} + subnet-id: ${{ vars.YC_SUBNET_ID }} + cores: 4 + memory: 8GB + core-fraction: 100 + disk-type: network-ssd-nonreplicated + disk-size: 93GB + + checkout: + name: Checkout sources + needs: start-vm + runs-on: ${{ needs.start-vm.outputs.label }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + check: + name: Run checks + needs: + - start-vm + - checkout + runs-on: ${{ needs.start-vm.outputs.label }} + env: + HOME: /root + steps: + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.19 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.11.2 + + - name: Build + shell: bash + run: | + make build + + - name: Run tests + shell: bash + run: | + [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.19.0/kind-linux-amd64 + chmod +x ./kind + sudo mv ./kind /usr/local/bin/kind + kind create cluster --retain -v 100 + kubectl get pod + kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml + + make helm-kind-install + docker pull ytsaurus/ytsaurus-nightly:dev-23.1-5f8638fc66f6e59c7a06708ed508804986a6579f + kind load docker-image ytsaurus/ytsaurus-nightly:dev-23.1-5f8638fc66f6e59c7a06708ed508804986a6579f + docker pull ytsaurus/ytsaurus-nightly:dev-23.1-9779e0140ff73f5a786bd5362313ef9a74fcd0de + kind load docker-image ytsaurus/ytsaurus-nightly:dev-23.1-9779e0140ff73f5a786bd5362313ef9a74fcd0de + docker pull ytsaurus/ytsaurus-nightly:dev-23.2-62a472c4efc2c8395d125a13ca0216720e06999d + kind load docker-image ytsaurus/ytsaurus-nightly:dev-23.2-62a472c4efc2c8395d125a13ca0216720e06999d + YTSAURUS_ENABLE_E2E_TESTS=true make test + helm uninstall ytsaurus + + ./compat_test.sh --from-version 0.4.1 --to-version trunk + + stop-vm: + name: Stop VM + needs: + - start-vm + - check + runs-on: ubuntu-latest + if: ${{ always() }} + steps: + - name: Stop YC runner + uses: yc-actions/yc-github-runner@v1 + with: + mode: stop + yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }} + github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + label: ${{ needs.start-vm.outputs.label }} + instance-id: ${{ needs.start-vm.outputs.instance-id }} From 81373132f9bf90becf8377aef7b6f1690a2886bd Mon Sep 17 00:00:00 2001 From: Kirill Sibirev Date: Fri, 8 Dec 2023 18:20:11 +0100 Subject: [PATCH 2/2] [do not merge] test workflow --- .github/workflows/check-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-pr.yaml b/.github/workflows/check-pr.yaml index b4811732..e6d1d10a 100644 --- a/.github/workflows/check-pr.yaml +++ b/.github/workflows/check-pr.yaml @@ -1,4 +1,4 @@ -name: Build and test +name: Build and test TEST PR on: pull_request: