generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
92 lines (92 loc) · 3.52 KB
/
smoketest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
on:
pull_request:
merge_group:
name: SmokeTest
concurrency:
group: ${{ github.ref }}-smoketest
cancel-in-progress: true
jobs:
smoke-test-upgrade-path:
name: Smoke Test Upgrade Path
# if: github.event_name != 'pull_request' || github.event.action == 'enqueued' || contains( github.event.pull_request.labels.*.name, 'run-all')
runs-on: ubuntu-latest
steps:
- name: Checkout the repository with full history
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
fetch-tags: true
- name: Get last tagged release
run: |
latest_release=$(git tag --sort=-v:refname | grep -v v1 | head -n 1)
echo "Latest release: $latest_release"
echo "LATEST_VERSION=${latest_release#v}" >> "$GITHUB_ENV"
- name: Check out the last tagged release
uses: actions/checkout@v4
with:
ref: v${{ env.LATEST_VERSION }}
fetch-depth: 1
fetch-tags: true
# - name: Download the release images
# uses: dsaltares/fetch-gh-release-asset@master
# with:
# repo: TBD54566975/ftl.git
# version: tags/v${{ env.LATEST_VERSION }}
# file: ftl-${{ env.LATEST_VERSION }}.linux-arm64.tar.gz
# token: ${{ secrets.GITHUB_TOKEN }}
# target: last-release.linux-arm64.tar.gz
- name: Check out the current smoke test
uses: actions/checkout@v4
with:
clean: false
repository: TBD54566975/ftl.git
path: tmpsmoketest
ref: ${{ github.head_ref }}
fetch-depth: 0
sparse-checkout: smoketest
sparse-checkout-cone-mode: false
- name: Init Hermit
uses: cashapp/activate-hermit@v1
with:
cache: true
- name: Build Cache
uses: ./.github/actions/build-cache
- name: Docker Compose
run: docker compose up -d --wait
- name: Create DB
run: just init-db
- name: Download Go Modules
run: go mod download
- name: Smoke test the tagged release
run: |
set -euo pipefail
echo "Replacing released exemplar with current exemplar"
rm -r ./smoketest && mv ./tmpsmoketest/smoketest ./smoketest && rm -r ./tmpsmoketest
echo "Running current smoke test on the tagged release"
go test -v -tags integration -run '^Test' ./smoketest
- name: Download the last tagged release asset
run: |
set -euo pipefail
release_url="https://github.com/TBD54566975/ftl/releases/download/v${{ env.LATEST_VERSION }}/ftl-${{ env.LATEST_VERSION }}.linux-amd64.tar.gz"
echo "Fetching latest release asset from: $release_url"
curl -L "$release_url" --output last-release.linux-amd64.tar.gz
- name: Replace deployment with release images
run: |
set -euo pipefail
ls -al .
mkdir -p last-release
tar -xzf last-release.linux-amd64.tar.gz -C last-release
if [ ! -f last-release/ftl ]; then
echo "Error: 'ftl' binary not found in the extracted files."
exit 1
fi
cp last-release/ftl ./build/devel/ftl
cp last-release/ftl ./build/release/ftl
# Next step is to build the FTL from HEAD, deploy it to the cluster, and run the smoke test
- name: Archive Report
uses: actions/upload-artifact@v4
if: always()
with:
name: kube-report-smoke-test-upgrade
path: /tmp/ftl-kube-report/