Skip to content

Commit b386657

Browse files
author
Christian Newman
committed
Add initial CI file
1 parent ce3b6c7 commit b386657

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: SCALAR Tagger CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test-docker:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Docker
16+
uses: docker/setup-buildx-action@v3
17+
18+
- name: Start Docker container
19+
run: |
20+
docker compose pull
21+
docker compose up -d
22+
23+
- name: Wait for service to start
24+
run: sleep 10
25+
26+
- name: Test tagger endpoint
27+
run: |
28+
response=$(curl -s "http://localhost:8080/cache/numberArray/DECLARATION")
29+
if [ -z "$response" ]; then
30+
echo "No response from tagger"
31+
exit 1
32+
fi
33+
echo "Received response: $response"
34+
35+
test-native:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Set up Python 3.12
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.12'
44+
45+
- name: Create and activate virtual environment
46+
run: |
47+
python -m venv /tmp/tagger
48+
source /tmp/tagger/bin/activate
49+
50+
- name: Install dependencies
51+
run: |
52+
pip install -r requirements.txt
53+
54+
- name: Start tagger server
55+
run: |
56+
./main -r &
57+
sleep 10
58+
59+
- name: Test tagger endpoint
60+
run: |
61+
response=$(curl -s "http://localhost:5000/cache/numberArray/DECLARATION")
62+
if [ -z "$response" ]; then
63+
echo "No response from tagger"
64+
exit 1
65+
fi
66+
echo "Received response: $response"

0 commit comments

Comments
 (0)