Some checks failed
Research feed publisher tests / test (push) Failing after 3s
Release / Pre-flight checks (push) Failing after 0s
Release / Research Edition — patch and packaging smoke tests (push) Has been skipped
Release / Build Qt artifacts (false, 22, ubuntu-22.04, 3.9, ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}, false, false) (push) Has been skipped
Release / Build Qt artifacts (false, 22, ubuntu-22.04, 3.9, false, false, false) (push) Has been skipped
Release / Build Qt artifacts (manylinux_2_28 — glibc 2.28 ABI floor) (22, 3.9) (push) Has been skipped
Release / Generate release notes (push) Has been skipped
Release / Create dev release tag (push) Has been skipped
CodeQL / Analyze (javascript) (push) Failing after 1s
CodeQL / Analyze (python) (push) Failing after 1s
Release / Build Qt artifacts (false, 22, windows-latest, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, macos-15-intel, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, macos-latest, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, ubuntu-24.04, 3.9, ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }}, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, ubuntu-24.04, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, ubuntu-24.04-arm, 3.9, false, false, false) (push) Has been cancelled
Release / Build Tauri artifacts (false, 22, windows-latest, 3.9, false, false, false) (push) Has been cancelled
Release / Build Qt artifacts (false, 22, macos-15-intel, 3.9, false, false, false) (push) Has been cancelled
Release / Build Qt artifacts (false, 22, macos-latest, 3.9, false, false, false) (push) Has been cancelled
Release / Publish draft release (push) Has been cancelled
176 lines
5.5 KiB
YAML
176 lines
5.5 KiB
YAML
name: Test
|
|
|
|
on:
|
|
#push:
|
|
# branches: [ master ]
|
|
#pull_request:
|
|
# branches: [ master ]
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
# an integration test designed to catch bugs triggered by updating (database migrations and such)
|
|
upgrades:
|
|
name: upgrade from ${{ matrix.aw_server_old }} ${{ matrix.aw_server_old_args }} to ${{ matrix.aw_server_new }} ${{ matrix.aw_server_new_args }}
|
|
# needs: [build]
|
|
#if: startsWith(github.ref, 'refs/tags/v') # only run on tag
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
old_version: 'v0.12.2'
|
|
new_version: 'v0.13.1'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
aw_server_old: ['aw-server', 'aw-server-rust']
|
|
aw_server_new: ['aw-server', 'aw-server-rust']
|
|
aw_server_old_args: ['']
|
|
aw_server_new_args: ['']
|
|
include:
|
|
# python, peewee (default)
|
|
- aw_server_old: 'aw-server'
|
|
aw_server_new: 'aw-server'
|
|
# python, sqlite
|
|
# FIXME: sqlite broken since aw-server enabled flask multithreading (new default)
|
|
- aw_server_old: "aw-server"
|
|
aw_server_new: "aw-server"
|
|
aw_server_old_args: "--storage sqlite"
|
|
aw_server_new_args: "--storage sqlite"
|
|
old_version: 'v0.12.2'
|
|
new_version: 'v0.13.1'
|
|
# python, peewee to sqlite
|
|
# FIXME: broken, same thing with sqlite as above
|
|
- aw_server_old: "aw-server"
|
|
aw_server_new: "aw-server"
|
|
aw_server_old_args: "--storage peewee"
|
|
aw_server_new_args: "--storage sqlite"
|
|
old_version: 'v0.12.2'
|
|
new_version: 'v0.13.1'
|
|
exclude:
|
|
# rust to python, not supported
|
|
- aw_server_old: 'aw-server-rust'
|
|
aw_server_new: 'aw-server'
|
|
|
|
steps:
|
|
# Will download all artifacts to path
|
|
- name: Download build artifacts
|
|
if: ${{ env.new_version == 'this' }}
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: builds-Linux-py3.9
|
|
path: dist
|
|
|
|
# Only used during testing, so we don't have to wait for the main build job
|
|
- name: Download new ActivityWatch
|
|
if: ${{ env.new_version != 'this' }}
|
|
run: |
|
|
mkdir dist
|
|
pushd dist
|
|
wget -q https://github.com/ActivityWatch/activitywatch/releases/download/${{ env.new_version }}/activitywatch-${{ env.new_version }}-linux-x86_64.zip
|
|
|
|
- name: Install new & old ActivityWatch
|
|
run: |
|
|
pushd dist
|
|
|
|
# New version
|
|
unzip activitywatch-*-linux-x86_64.zip
|
|
mv activitywatch/ aw-new
|
|
|
|
# Old version
|
|
wget -q -O aw-old.zip https://github.com/ActivityWatch/activitywatch/releases/download/${{ env.old_version }}/activitywatch-${{ env.old_version }}-linux-x86_64.zip
|
|
unzip aw-old.zip
|
|
mv activitywatch/ aw-old
|
|
|
|
- name: Display structure of downloaded files
|
|
run: ls -R
|
|
working-directory: dist
|
|
|
|
- name: Run and test old server
|
|
run: |
|
|
bin=dist/aw-old/${{ matrix.aw_server_old }}/${{ matrix.aw_server_old }}
|
|
url="http://localhost:5600"
|
|
|
|
# Check version
|
|
$bin --version || true # due to bug in old aw-server
|
|
|
|
# Run server and log output
|
|
$bin ${{ matrix.aw_server_old_args }} >> log-old.txt 2>&1 &
|
|
sleep 5 # wait for startup
|
|
|
|
# Set server URL
|
|
|
|
# Get server info
|
|
curl "$url/api/0/info" --fail-with-body
|
|
|
|
# Create bucket
|
|
curl -X 'POST' --fail-with-body \
|
|
"$url/api/0/buckets/aw-test" \
|
|
-H 'accept: application/json' \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{
|
|
"client": "test",
|
|
"type": "test",
|
|
"hostname": "test"
|
|
}'
|
|
|
|
# Get buckets
|
|
curl "$url/api/0/buckets/" -H 'accept: application/json'
|
|
|
|
# Send a heartbeat
|
|
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
curl -X 'POST' \
|
|
"$url/api/0/buckets/aw-test/heartbeat?pulsetime=0" \
|
|
-H 'accept: application/json' \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{
|
|
"timestamp": "'$timestamp'",
|
|
"duration": 0,
|
|
"data": {"key": "test value"}
|
|
}'
|
|
|
|
# Give a sec, then kill server process
|
|
sleep 1
|
|
kill $!
|
|
|
|
- name: Run and test new server
|
|
run: |
|
|
bin=dist/aw-new/${{ matrix.aw_server_new }}/${{ matrix.aw_server_new }}
|
|
url="http://localhost:5600"
|
|
|
|
# Check version
|
|
$bin --version
|
|
|
|
# Run server and log output
|
|
$bin ${{ matrix.aw_server_new_args }} >> log-new.txt 2>&1 &
|
|
sleep 5 # wait for startup
|
|
|
|
# Get server info
|
|
curl "$url/api/0/info"
|
|
|
|
# Get buckets
|
|
curl "$url/api/0/buckets/" -H 'accept: application/json'
|
|
|
|
# Send a heartbeat
|
|
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
curl -X 'POST' --fail-with-body \
|
|
"$url/api/0/buckets/aw-test/heartbeat?pulsetime=60" \
|
|
-H 'accept: application/json' \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{
|
|
"timestamp": "'$timestamp'",
|
|
"duration": 0,
|
|
"data": {"key": "test value"}
|
|
}'
|
|
|
|
# Give a sec, then kill server process
|
|
sleep 1
|
|
kill $!
|
|
|
|
- name: Output logs
|
|
if: always()
|
|
run: |
|
|
cat log-old.txt || true
|
|
echo "\n---\n"
|
|
cat log-new.txt || true
|
|
|