Skip to content

Commit f9c57b5

Browse files
Remove 3.8 test
1 parent 6bbbad0 commit f9c57b5

File tree

1 file changed

+44
-65
lines changed

1 file changed

+44
-65
lines changed

.github/workflows/tests.yaml

Lines changed: 44 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Tests
33
on:
44
push:
55
paths:
6-
- .github/workflows/tests.yaml
7-
- pyproject.toml
8-
- poetry.lock
9-
- tsdfileapi/**
6+
- .github/workflows/tests.yaml
7+
- pyproject.toml
8+
- poetry.lock
9+
- tsdfileapi/**
1010
pull_request:
1111
types: [opened, reopened, synchronize]
1212
paths:
13-
- .github/workflows/tests.yaml
14-
- pyproject.toml
15-
- poetry.lock
16-
- tsdfileapi/**
13+
- .github/workflows/tests.yaml
14+
- pyproject.toml
15+
- poetry.lock
16+
- tsdfileapi/**
1717

1818
env:
1919
TSD_FILE_API_DB_NAME: tsd_file_api_db
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
31+
python-version: ["3.9", "3.10", "3.11", "3.12"]
3232

3333
services:
3434
postgres:
@@ -38,62 +38,41 @@ jobs:
3838
POSTGRES_USER: ${{env.TSD_FILE_API_DB_USER}}
3939
POSTGRES_PASSWORD: ${{env.TSD_FILE_API_DB_PASS}}
4040
options: >-
41-
--health-cmd pg_isready
42-
--health-interval 10s
43-
--health-timeout 5s
44-
--health-retries 5
41+
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
4542
ports:
46-
- 5432:5432
43+
- 5432:5432
4744

4845
steps:
49-
- name: Check out repository
50-
uses: actions/checkout@v4
51-
- name: Set container tag to variable
52-
run: echo "CONTAINER_TAG=tsd-file-api:${{ github.sha }}-py${{ matrix.python-version }}-r${{ github.run_attempt }}" >> $GITHUB_ENV
53-
- name: Build test container image
54-
run: >
55-
docker build
56-
--tag "${{ env.CONTAINER_TAG }}"
57-
--build-arg PYTHON_VERSION="${{ matrix.python-version }}"
58-
--build-arg POETRY_VERSION="${{env.POETRY_VERSION}}"
59-
-f "./containers/test/Dockerfile"
60-
.
61-
- name: Start tsd-file-api container and run tests (SQLite backend)
62-
run: >
63-
docker run -d
64-
-v $PWD:/file-api:ro
65-
--name tsd-file-api-sqlite
66-
--health-cmd "curl --fail http://127.0.0.1:3003/v1/all/config || exit 1"
67-
--health-interval=2s
68-
"${{ env.CONTAINER_TAG }}" && sleep 1 &&
69-
until [ "$(docker inspect -f {{.State.Health.Status}} tsd-file-api-sqlite)" == "healthy" ]; do
70-
if [ "$(docker inspect -f {{.State.Running}} tsd-file-api-sqlite)" == "false" ]; then
71-
echo "The tsd-file-api container appears to have crashed."
72-
exit 1
73-
else
74-
sleep 0.1
75-
fi; done &&
76-
docker exec tsd-file-api-sqlite python tsdfileapi/test_file_api.py
77-
- name: Log tsd-file-api (SQLite backend) container output on failure
78-
if: ${{ failure() }}
79-
run: docker logs tsd-file-api-sqlite
80-
- name: Start tsd-file-api container and run tests (PostgreSQL backend)
81-
run: >
82-
docker run -d
83-
-v $PWD:/file-api:ro
84-
--name tsd-file-api-postgres
85-
--health-cmd "curl --fail http://127.0.0.1:3003/v1/all/config || exit 1"
86-
--health-interval=2s
87-
"${{ env.CONTAINER_TAG }}"
88-
tsdfileapi/config/config-test-container-postgres.yaml && sleep 1 &&
89-
until [ "$(docker inspect -f {{.State.Health.Status}} tsd-file-api-postgres)" == "healthy" ]; do
90-
if [ "$(docker inspect -f {{.State.Running}} tsd-file-api-postgres)" == "false" ]; then
91-
echo "The tsd-file-api container appears to have crashed."
92-
exit 1
93-
else
94-
sleep 0.1
95-
fi; done &&
96-
docker exec tsd-file-api-postgres python tsdfileapi/test_file_api.py
97-
- name: Log tsd-file-api (PostgreSQL backend) container output on failure
98-
if: ${{ failure() }}
99-
run: docker logs tsd-file-api-postgres
46+
- name: Check out repository
47+
uses: actions/checkout@v4
48+
- name: Set container tag to variable
49+
run: echo "CONTAINER_TAG=tsd-file-api:${{ github.sha }}-py${{ matrix.python-version }}-r${{ github.run_attempt }}" >> $GITHUB_ENV
50+
- name: Build test container image
51+
run: >
52+
docker build --tag "${{ env.CONTAINER_TAG }}" --build-arg PYTHON_VERSION="${{ matrix.python-version }}" --build-arg POETRY_VERSION="${{env.POETRY_VERSION}}" -f "./containers/test/Dockerfile" .
53+
- name: Start tsd-file-api container and run tests (SQLite backend)
54+
run: >
55+
docker run -d -v $PWD:/file-api:ro --name tsd-file-api-sqlite --health-cmd "curl --fail http://127.0.0.1:3003/v1/all/config || exit 1" --health-interval=2s "${{ env.CONTAINER_TAG }}" && sleep 1 && until [ "$(docker inspect -f {{.State.Health.Status}} tsd-file-api-sqlite)" == "healthy" ]; do
56+
if [ "$(docker inspect -f {{.State.Running}} tsd-file-api-sqlite)" == "false" ]; then
57+
echo "The tsd-file-api container appears to have crashed."
58+
exit 1
59+
else
60+
sleep 0.1
61+
fi; done &&
62+
docker exec tsd-file-api-sqlite python tsdfileapi/test_file_api.py
63+
- name: Log tsd-file-api (SQLite backend) container output on failure
64+
if: ${{ failure() }}
65+
run: docker logs tsd-file-api-sqlite
66+
- name: Start tsd-file-api container and run tests (PostgreSQL backend)
67+
run: >
68+
docker run -d -v $PWD:/file-api:ro --name tsd-file-api-postgres --health-cmd "curl --fail http://127.0.0.1:3003/v1/all/config || exit 1" --health-interval=2s "${{ env.CONTAINER_TAG }}" tsdfileapi/config/config-test-container-postgres.yaml && sleep 1 && until [ "$(docker inspect -f {{.State.Health.Status}} tsd-file-api-postgres)" == "healthy" ]; do
69+
if [ "$(docker inspect -f {{.State.Running}} tsd-file-api-postgres)" == "false" ]; then
70+
echo "The tsd-file-api container appears to have crashed."
71+
exit 1
72+
else
73+
sleep 0.1
74+
fi; done &&
75+
docker exec tsd-file-api-postgres python tsdfileapi/test_file_api.py
76+
- name: Log tsd-file-api (PostgreSQL backend) container output on failure
77+
if: ${{ failure() }}
78+
run: docker logs tsd-file-api-postgres

0 commit comments

Comments
 (0)