Tests #2902
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "client/scripts/ci" | |
| - "client/scripts/minio" | |
| - ".github/workflows/tests.yml" | |
| - "**/*.go" | |
| - go.mod | |
| schedule: | |
| - cron: "0 8 * * *" | |
| pull_request: | |
| repository_dispatch: | |
| types: [tests] | |
| workflow_dispatch: | |
| env: | |
| TASK_X_REMOTE_TASKFILES: 1 | |
| jobs: | |
| unit_server: | |
| name: Tests | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: server/go.mod | |
| - name: Install Task | |
| uses: go-task/setup-task@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gpg | |
| task --yes server:deps:install:c | |
| - name: Set up git config | |
| run: task --yes ci:setup:git-config | |
| - name: Install 3p-git-signatures | |
| run: task --yes ci:install:3p-git-signatures | |
| - name: Install ginkgo | |
| run: task --yes deps:install:ginkgo | |
| - name: Test | |
| run: | | |
| task --yes server:test:unit | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: unit_coverage | |
| path: tests_coverage | |
| ai_tests_server: | |
| name: AI-authored tests | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: server/go.mod | |
| - name: Install Task | |
| uses: go-task/setup-task@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gpg | |
| task --yes server:deps:install:c | |
| - name: Set up git config | |
| run: task --yes ci:setup:git-config | |
| - name: Install 3p-git-signatures | |
| run: task --yes ci:install:3p-git-signatures | |
| - name: Install ginkgo | |
| run: task --yes deps:install:ginkgo | |
| - name: Start buildkitd | |
| run: | | |
| docker run --detach --name trdl-buildkitd --privileged \ | |
| --publish 1234:1234 moby/buildkit:v0.31.2 --addr tcp://0.0.0.0:1234 | |
| timeout 120 bash -c 'until docker exec trdl-buildkitd \ | |
| buildctl --addr tcp://127.0.0.1:1234 debug workers >/dev/null 2>&1; do sleep 2; done' | |
| - name: Test | |
| env: | |
| TRDL_SMOKE_BUILDKITD_ADDRESS: tcp://127.0.0.1:1234 | |
| run: task --yes server:test:ai | |
| unit_client: | |
| name: Client unit tests | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: client/go.mod | |
| - name: Install Task | |
| uses: go-task/setup-task@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Test | |
| run: task --yes client:test:unit | |
| e2e_tests: | |
| name: End-to-end tests | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: e2e/go.mod | |
| - name: Install Task | |
| uses: go-task/setup-task@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up prebuilt trdl test binary | |
| run: | | |
| task --yes client:build-with-coverage | |
| echo TRDL_TEST_BINARY_PATH=$GITHUB_WORKSPACE/bin/coverage/trdl >> $GITHUB_ENV | |
| echo TRDL_TEST_COVERAGE_DIR=$GITHUB_WORKSPACE/tests_coverage/e2e >> $GITHUB_ENV | |
| - name: Set up git config | |
| run: task --yes ci:setup:git-config | |
| - name: Prepare environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gpg | |
| task --yes server:deps:install:c | |
| - name: Install 3p-git-signatures | |
| run: task --yes ci:install:3p-git-signatures | |
| - name: Install ginkgo | |
| run: task --yes -p deps:install:ginkgo | |
| - name: Setup vault | |
| run: | | |
| task --yes server:setup-vault-local | |
| echo "$HOME/bin" >> $GITHUB_PATH | |
| - name: Test | |
| run: task --yes e2e:test:e2e | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: e2e_coverage | |
| path: tests_coverage | |
| e2e_buildx_config: | |
| name: End-to-end tests (buildx driver from configure) | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| # The environment names a driver that cannot work here — there is no cluster | |
| # — while the project configuration names the working one. The release can | |
| # only succeed if the configured driver reaches the build, so this job fails | |
| # if the value stops being forwarded anywhere along the way. | |
| env: | |
| TRDL_BUILDX_DRIVER: kubernetes | |
| TRDL_TEST_BUILDX_DRIVER: docker-container | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: e2e/go.mod | |
| - name: Install Task | |
| uses: go-task/setup-task@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up prebuilt trdl test binary | |
| run: | | |
| task --yes client:build-with-coverage | |
| echo TRDL_TEST_BINARY_PATH=$GITHUB_WORKSPACE/bin/coverage/trdl >> $GITHUB_ENV | |
| echo TRDL_TEST_COVERAGE_DIR=$GITHUB_WORKSPACE/tests_coverage/e2e >> $GITHUB_ENV | |
| - name: Set up git config | |
| run: task --yes ci:setup:git-config | |
| - name: Prepare environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gpg | |
| task --yes server:deps:install:c | |
| - name: Install 3p-git-signatures | |
| run: task --yes ci:install:3p-git-signatures | |
| - name: Install ginkgo | |
| run: task --yes -p deps:install:ginkgo | |
| - name: Setup vault | |
| run: | | |
| task --yes server:setup-vault-local | |
| echo "$HOME/bin" >> $GITHUB_PATH | |
| - name: Test | |
| run: task --yes e2e:test:e2e:flow-vault | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: e2e_coverage_buildx_config | |
| path: tests_coverage | |
| e2e_buildkit: | |
| name: End-to-end tests (BuildKit client) | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: e2e/go.mod | |
| - name: Install Task | |
| uses: go-task/setup-task@v2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up prebuilt trdl test binary | |
| run: | | |
| task --yes client:build-with-coverage | |
| echo TRDL_TEST_BINARY_PATH=$GITHUB_WORKSPACE/bin/coverage/trdl >> $GITHUB_ENV | |
| echo TRDL_TEST_COVERAGE_DIR=$GITHUB_WORKSPACE/tests_coverage/e2e >> $GITHUB_ENV | |
| - name: Set up git config | |
| run: task --yes ci:setup:git-config | |
| - name: Prepare environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gpg | |
| task --yes server:deps:install:c | |
| - name: Install 3p-git-signatures | |
| run: task --yes ci:install:3p-git-signatures | |
| - name: Install ginkgo | |
| run: task --yes -p deps:install:ginkgo | |
| - name: Setup vault | |
| run: | | |
| task --yes server:setup-vault-local | |
| echo "$HOME/bin" >> $GITHUB_PATH | |
| - name: Start buildkitd | |
| run: | | |
| docker run --detach --name trdl-buildkitd --privileged \ | |
| --publish 1234:1234 moby/buildkit:v0.31.2 --addr tcp://0.0.0.0:1234 | |
| timeout 120 bash -c 'until docker exec trdl-buildkitd \ | |
| buildctl --addr tcp://127.0.0.1:1234 debug workers >/dev/null 2>&1; do sleep 2; done' | |
| - name: Test | |
| env: | |
| TRDL_TEST_BUILDKITD_ADDRESS: tcp://127.0.0.1:1234 | |
| run: task --yes e2e:test:e2e:flow-vault | |
| - name: Collect buildkitd diagnostics | |
| if: failure() | |
| run: docker logs trdl-buildkitd || true | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: e2e_coverage_buildkit | |
| path: tests_coverage | |
| upload_coverage: | |
| name: Upload coverage | |
| needs: | |
| - unit_server | |
| - e2e_tests | |
| - e2e_buildkit | |
| - e2e_buildx_config | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Download coverage artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: tests_coverage | |
| - name: Upload coverage report | |
| uses: qltysh/qlty-action/coverage@v2 | |
| with: | |
| token: ${{secrets.QLTY_COVERAGE_TOKEN}} | |
| files: tests_coverage/**/*.out | |
| skip-errors: false | |
| notification: | |
| name: Notification | |
| if: always() | |
| needs: | |
| - unit_server | |
| - ai_tests_server | |
| - unit_client | |
| - e2e_tests | |
| - e2e_buildkit | |
| - e2e_buildx_config | |
| - upload_coverage | |
| uses: werf/common-ci/.github/workflows/notification.yml@main | |
| secrets: | |
| loopNotificationGroup: ${{ secrets.LOOP_NOTIFICATION_GROUP }} | |
| webhook: ${{ secrets.LOOP_NOTIFICATION_WEBHOOK }} | |
| notificationChannel: ${{ secrets.LOOP_NOTIFICATION_CHANNEL }} |