1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-10 05:04:15 +08:00

TUN-9800: Migrate cloudflared-ci pipelines to Gitlab CI

## Summary

This commit migrates the cloduflared ci pipelines, that built, tested and component tested the linux binaries to gitlab ci.

The only thing that is remaining to move from teamcity to gitlab are now the release pipelines that run on master.

Relates to TUN-9800
This commit is contained in:
João "Pisco" Fernandes
2025-09-11 11:33:24 +01:00
parent d9e13ab2ab
commit 173396be90
14 changed files with 209 additions and 83 deletions

25
.ci/scripts/component-tests.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -e -o pipefail
# Fetch cloudflared from the artifacts folder
mv ./artifacts/cloudflared ./cloudflared
python3 -m venv env
. env/bin/activate
pip install --upgrade -r component-tests/requirements.txt
# Creates and routes a Named Tunnel for this build. Also constructs
# config file from env vars.
python3 component-tests/setup.py --type create
# Define the cleanup function
cleanup() {
# The Named Tunnel is deleted and its route unprovisioned here.
python3 component-tests/setup.py --type cleanup
}
# The trap will call the cleanup function on script exit
trap cleanup EXIT
pytest component-tests -o log_cli=true --log-cli-level=INFO --junit-xml=report.xml

13
.ci/scripts/fmt-check.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -e -o pipefail
OUTPUT=$(go run -mod=readonly golang.org/x/tools/cmd/goimports@v0.30.0 -l -d -local github.com/cloudflare/cloudflared $(go list -mod=vendor -f '{{.Dir}}' -a ./... | fgrep -v tunnelrpc))
if [ -n "$OUTPUT" ] ; then
PAGER=$(which colordiff || echo cat)
echo
echo "Code formatting issues found, use 'make fmt' to correct them"
echo
echo "$OUTPUT" | $PAGER
exit 1
fi

View File

@@ -31,7 +31,7 @@ Write-Host "Running component tests"
try {
python -m pip --disable-pip-version-check install --upgrade -r component-tests/requirements.txt --use-pep517
python component-tests/setup.py --type create
python -m pytest component-tests -o log_cli=true --log-cli-level=INFO
python -m pytest component-tests -o log_cli=true --log-cli-level=INFO --junit-xml=report.xml
if ($LASTEXITCODE -ne 0) {
throw "Failed component tests"
}

View File

@@ -3,7 +3,7 @@ Param(
[string]$ScriptToExecute
)
# This script its a wrapper that downloads a specific version
# The script is a wrapper that downloads a specific version
# of go, adds it to the PATH and executes a script with that go
# version in the path.