diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index af42cb67..d2ba1ca3 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -20,13 +20,18 @@ jobs: - i18n - palemoon/amd64 - palemoon/i386 - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + - name: Setup tmate session + uses: mxschmitt/action-tmate@7b6a61a73bbb9793cb80ad69b8dd8ac19261834c # v3.22 + with: + detached: true + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: latest @@ -45,3 +50,14 @@ jobs: run: | cd test/${{ matrix.test }} backoff-retry --try-count 10 ./test.sh + + - name: Sanitize artifact name + if: always() + run: echo "ARTIFACT_NAME=${{ matrix.test }}" | sed 's|/|-|g' >> $GITHUB_ENV + + - name: Upload artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + if: always() + with: + name: ${{ env.ARTIFACT_NAME }} + path: test/${{ matrix.test }}/var diff --git a/test/cmd/cipra/main.go b/test/cmd/cipra/main.go index d5bfbe10..e6f3f7ee 100644 --- a/test/cmd/cipra/main.go +++ b/test/cmd/cipra/main.go @@ -28,7 +28,7 @@ func main() { flagenv.Parse() flag.Parse() - ctx, cancel := context.WithTimeout(context.Background(), 60*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) defer cancel() lanip, err := internal.GetLANIP() diff --git a/test/i18n/var/.gitignore b/test/i18n/var/.gitignore new file mode 100644 index 00000000..c96a04f0 --- /dev/null +++ b/test/i18n/var/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/test/lib/lib.sh b/test/lib/lib.sh index 1d7fee7e..2fc0b11b 100644 --- a/test/lib/lib.sh +++ b/test/lib/lib.sh @@ -13,6 +13,9 @@ function cleanup() { trap cleanup EXIT SIGINT function build_anubis_ko() { + ( + cd $REPO_ROOT && npm ci && npm run assets + ) ( cd $REPO_ROOT && VERSION=devel ko build \ @@ -40,7 +43,9 @@ function mint_cert() { ( cd ${REPO_ROOT}/test/pki && mkdir -p "${domainName}" && - go tool minica -domains "${domainName}" + go tool minica -domains "${domainName}" && + cd "${domainName}" && + chmod 666 * ) fi } diff --git a/test/palemoon/amd64/docker-compose.yml b/test/palemoon/amd64/docker-compose.yml index eb179daa..9403df3b 100644 --- a/test/palemoon/amd64/docker-compose.yml +++ b/test/palemoon/amd64/docker-compose.yml @@ -2,8 +2,8 @@ services: display: image: ghcr.io/techarohq/ci-images/xserver:latest pull_policy: always - # ports: - # - 5900:5900 + ports: + - 5900:5900 anubis: image: ko.local/anubis @@ -14,6 +14,8 @@ services: SLOG_LEVEL: DEBUG volumes: - ../anubis:/cfg + depends_on: + - relayd relayd: image: ghcr.io/xe/x/relayd @@ -42,3 +44,7 @@ services: volumes: - ../../pki:/usr/local/share/ca-certificates/minica:ro - ../scripts:/hack/scripts:ro + depends_on: + - anubis + - relayd + - display diff --git a/test/palemoon/amd64/test.sh b/test/palemoon/amd64/test.sh index 23cd1146..dc093cc7 100755 --- a/test/palemoon/amd64/test.sh +++ b/test/palemoon/amd64/test.sh @@ -1,9 +1,26 @@ #!/usr/bin/env bash -set -euo pipefail +export VERSION=$GITHUB_COMMIT-test +export KO_DOCKER_REPO=ko.local + +function capture_vnc_snapshots() { + sudo apt-get update && sudo apt-get install -y gvncviewer + mkdir -p ./var + while true; do + timestamp=$(date +"%Y%m%d%H%M%S") + gvnccapture localhost:0 ./var/snapshot_$timestamp.png 2>/dev/null + sleep 1 + done +} source ../../lib/lib.sh +if [ "$GITHUB_ACTIONS" = "true" ]; then + capture_vnc_snapshots & +fi + +set -euo pipefail + build_anubis_ko mint_cert relayd diff --git a/test/palemoon/i386/docker-compose.yml b/test/palemoon/i386/docker-compose.yml index eae20dbe..cda915da 100644 --- a/test/palemoon/i386/docker-compose.yml +++ b/test/palemoon/i386/docker-compose.yml @@ -2,8 +2,8 @@ services: display: image: ghcr.io/techarohq/ci-images/xserver:latest pull_policy: always - # ports: - # - 5900:5900 + ports: + - 5900:5900 anubis: image: ko.local/anubis diff --git a/test/palemoon/i386/test.sh b/test/palemoon/i386/test.sh index 23cd1146..63767435 100755 --- a/test/palemoon/i386/test.sh +++ b/test/palemoon/i386/test.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +export VERSION=$GITHUB_COMMIT-test +export KO_DOCKER_REPO=ko.local + set -euo pipefail source ../../lib/lib.sh diff --git a/test/palemoon/i386/var/.gitignore b/test/palemoon/i386/var/.gitignore new file mode 100644 index 00000000..c96a04f0 --- /dev/null +++ b/test/palemoon/i386/var/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/test/palemoon/test.sh b/test/palemoon/test.sh deleted file mode 100755 index a7a6ba93..00000000 --- a/test/palemoon/test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail -set -x - -(cd amd64 && ./test.sh && docker compose down -t0 && docker compose rm) -(cd i386 && ./test.sh && docker compose down -t0 && docker compose rm)