Skip to content

chore: release 0.14.0 #3020

chore: release 0.14.0

chore: release 0.14.0 #3020

Workflow file for this run

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: 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:unit
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: unit_coverage
path: tests_coverage
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_buildkitd_driver_forwarding:
name: End-to-end tests (buildkitd driver forwarding)
runs-on: ubuntu-22.04
timeout-minutes: 30
# The mirror image of e2e_buildx_config, for a driver that cannot succeed
# without a cluster. The configuration names the kubernetes buildkitd driver
# and a namespace; TRDL_BUILDX_DRIVER only spells out the fallback the code
# would take anyway, so that the path this job forbids is written down.
# The release therefore has to FAIL, and with the driver's own error naming
# that namespace: if the driver stops being forwarded the build falls back to
# the docker CLI and succeeds, and if the OPTIONS stop being forwarded the
# namespace is the kubeconfig's instead. The kubeconfig below points at a
# closed port precisely so the driver gets past client configuration and
# reaches pod creation, which is where the namespace becomes observable.
env:
TRDL_BUILDX_DRIVER: docker-container
TRDL_TEST_BUILDKITD_DRIVER: kubernetes
TRDL_TEST_BUILDKITD_DRIVER_OPTS_NAMESPACE: namespace=trdl-forwarding-guard
KUBECONFIG: /tmp/guard-kubeconfig.yaml
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: Write a kubeconfig pointing at a closed port
run: |
# Its namespace is deliberately NOT the configured one: the driver must
# take the namespace from buildkitd_driver_opts, and this is what makes
# the difference observable in the error.
cat > /tmp/guard-kubeconfig.yaml <<'EOF'
apiVersion: v1
kind: Config
clusters:
- name: unreachable
cluster:
server: https://127.0.0.1:1
contexts:
- name: unreachable
context:
cluster: unreachable
user: none
namespace: kubeconfig-namespace
current-context: unreachable
users:
- name: none
user: {}
EOF
- name: Setup vault
run: |
task --yes server:setup-vault-local
echo "$HOME/bin" >> $GITHUB_PATH
- name: Test
run: |
set -o pipefail
task --yes e2e:test:e2e paths='./tests/flow_vault' labelFilter='buildkitd-driver-forwarding' 2>&1 | tee /tmp/guard.log
- name: Assert the guard actually ran
run: |
# A green ginkgo run proves nothing on its own: it exits 0 when the
# label filter selects no spec at all, and at --vv it prints a skipped
# spec's name too, so neither the exit code nor the spec's name shows
# that this guard executed.
# No anchor on the first: ginkgo colours that line, so it does not
# start with "Ran".
grep -qE 'Ran [1-9][0-9]* of [0-9]+ Specs' /tmp/guard.log
# Only the guard itself can put this in the log — it is the release
# output the spec asserts on, and no other spec produces it.
grep -q 'unable to create builder pod trdl-forwarding-guard/' /tmp/guard.log
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: e2e_coverage_buildkitd_driver_forwarding
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
- e2e_buildkitd_driver_forwarding
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
- unit_client
- e2e_tests
- e2e_buildkit
- e2e_buildx_config
- e2e_buildkitd_driver_forwarding
- 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 }}