-
Notifications
You must be signed in to change notification settings - Fork 10
107 lines (90 loc) · 3.09 KB
/
tests.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: tests
on:
push:
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
unit-tests:
runs-on: ubuntu-latest
- uses: actions/checkout@v4
- name: Download and build bluesky-pods
run: |
docker pull ghcr.io/bluesky/bluesky-pods-bluesky:main
docker tag ghcr.io/bluesky/bluesky-pods-bluesky:main bluesky:latest
- name: Start Bluesky containers
run: |
pushd bluesky_adaptive/tests/podman
docker-compose up -d
popd
- name: Log which containers are running
run: docker ps -a
- name: Check container status and fetch logs if any failed
run: |
failed_containers=()
while read -r container; do
status=$(docker inspect --format='{{.State.Status}}' "$container")
if [ "$status" != "running" ]; then
echo "::error ::Container $container has status $status"
failed_containers+=("$container")
fi
done < <(docker ps -aq)
for container in "${failed_containers[@]}"; do
echo "Logs for $container:"
docker logs "$container"
done
if [ ${#failed_containers[@]} -ne 0 ]; then
echo "::error ::Some containers failed to start"
docker ps -a
exit 1
fi
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install
# shell: bash -l {0}
# run: |
# set -vxeuo pipefail
# pip install --upgrade pip wheel
# pip install .
# pip install -r requirements-dev.txt
# pip install -r requirements-agents.txt
# mkdir -p /home/runner/.config/tiled/profiles
# cp ./bluesky_adaptive/tests/podman/tiled_client_config.yml /home/runner/.config/tiled/profiles/tiled_client_config.yml
# pip list
- name: Reload Permissions for QServer (Ensures plans are available)
shell: bash -l {0}
run: |
set -vxeuo pipefail
qserver environment open
qserver permissions reload
- name: Setup and Test Python Versions
run: |
for version in 3.11 3.12; do
echo "Setting up Python $version"
sudo apt-get install -y python$version python$version-venv
python$version -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install .
pip install -r requirements-dev.txt
pip install -r requirements-agents.txt
mkdir -p /home/runner/.config/tiled/profiles
cp ./bluesky_adaptive/tests/podman/tiled_client_config.yml /home/runner/.config/tiled/profiles/tiled_client_config.yml
pip list
echo "Running tests with Python $version"
coverage run -m pytest -v
coverage report
deactivate
rm -rf venv
done
# - name: Test with pytest
# shell: bash -l {0}
# run: |
# set -vxeuo pipefail
# coverage run -m pytest -v
# coverage report