-
Notifications
You must be signed in to change notification settings - Fork 1.1k
138 lines (125 loc) · 4.74 KB
/
Copy pathupdate-test.yaml
File metadata and controls
138 lines (125 loc) · 4.74 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Update and Downgrade
"on":
push:
branches:
- main
- ?.*.x
- prerelease_test
pull_request:
workflow_dispatch:
jobs:
check_paths:
runs-on: ubuntu-latest
outputs:
run_ci: >-
${{ github.event_name == 'push'
|| (steps.filter.outputs.src == 'true' && !contains(github.event.pull_request.labels.*.name, 'skip-ci'))
}}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: .github/filters.yaml
update_test:
needs: check_paths
if: needs.check_paths.outputs.run_ci == 'true'
name: Update test PG${{ matrix.pg }} ${{ matrix.mode }}
runs-on: 'ubuntu-latest'
strategy:
matrix:
pg: [16, 17, 18]
mode: [direct, singlestep]
fail-fast: false
env:
PG_VERSION: ${{ matrix.pg }}
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- name: Checkout TimescaleDB
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Linux Dependencies
timeout-minutes: 15
run: |
sudo apt-get update
sudo apt-get install gnupg systemd-coredump gdb postgresql-common libkrb5-dev
yes | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list
wget --quiet --tries=6 --waitretry=15 -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-${{ matrix.pg }} postgresql-server-dev-${{ matrix.pg }}
# The unversioned timescaledb-2-postgresql package only ships update
# scripts that jump straight to the latest version. Install every
# versioned package instead so the extension directory also has the
# consecutive update scripts the singlestep update test needs.
ts_packages=$(apt-cache search --names-only '^timescaledb-2-[0-9].*-postgresql-${{ matrix.pg }}$' | awk '{ print $1 }')
sudo apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-overwrite" ${ts_packages}
git fetch --tags
- name: Update tests PG${{ matrix.pg }} ${{ matrix.mode }}
run: |
PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH"
UPDATE_MODE=${{ matrix.mode }} ./scripts/test_updates.sh
- name: Downgrade tests PG${{ matrix.pg }}
if: always() && matrix.mode == 'direct'
run: |
PATH="/usr/lib/postgresql/${{ matrix.pg }}/bin:$PATH"
./scripts/test_downgrade.sh
- name: Update diff
if: failure()
run: |
find update_test -name "*.diff" -print0 | xargs -0 -IFILE sh -c "echo '\nFILE\n';cat FILE"
- name: Postgres Errors
if: failure()
run: |
find update_test -name postgres.log -exec grep ERROR {} \;
- name: Check for coredumps
if: failure()
id: collectlogs
run: |
# wait for in progress coredumps
sleep 10
if coredumpctl list; then
echo "coredumps=true" >>$GITHUB_OUTPUT
false
fi
- name: Stack trace
if: always() && steps.collectlogs.outputs.coredumps == 'true'
run: |
sudo coredumpctl gdb <<<"
set verbose on
set trace-commands on
show debug-file-directory
printf "'"'"query = '%s'\n\n"'"'", (char *) debug_query_string
frame function ExceptionalCondition
printf "'"'"condition = '%s'\n"'"'", (char *) conditionName
up 1
l
info args
info locals
bt full
" 2>&1 | tee stacktrace.log
./scripts/bundle_coredumps.sh
false
- name: Upload Coredumps
if: always() && steps.collectlogs.outputs.coredumps == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Coredumps update-test PG${{ matrix.pg }} ${{ matrix.mode }}
path: coredumps
- name: Upload Artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Update test PG${{ matrix.pg }} ${{ matrix.mode }}
path: update_test
report_status:
name: Update and Downgrade summary
needs: [check_paths, update_test]
if: always()
runs-on: timescaledb-runner-arm64
steps:
- run: |
# If the detector failed, or the matrix failed, exit with error
if [[ "${{ needs.update_test.result }}" == "failure" ]]; then
exit 1
fi
echo "All checks passed or were safely skipped."