-
Notifications
You must be signed in to change notification settings - Fork 25
72 lines (61 loc) · 1.89 KB
/
test.yaml
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
name: test
on:
push:
branches: [main]
pull_request:
jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 60
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- uses: actions/cache@v4
with:
path: |
~/.cache/uv
key: ${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}
- name: Set up virtualenv
run: |
uv venv env --python=python3.10
source env/bin/activate
python --version
pip install setuptools
- name: Set up configs
env:
TNS_BOT_ID: ${{ secrets.TNS_BOT_ID }}
TNS_BOT_NAME: ${{ secrets.TNS_BOT_NAME }}
TNS_API_KEY: ${{ secrets.TNS_API_KEY }}
run: |
cp docker-compose.defaults.yaml docker-compose.yaml
cat << EOF >> docker.yaml
tns:
url: https://www.wis-tns.org
bot_id: $TNS_BOT_ID
bot_name: $TNS_BOT_NAME
api_key: $TNS_API_KEY
EOF
- name: Build and spin up
run: |
source env/bin/activate
make docker_build && make docker_up
- name: Cooldown to let the app start
run: sleep 10
- name: Run tests
run: |
source env/bin/activate
make docker_test
- name: Collect Docker Logs
uses: jwalton/[email protected]
with:
images: 'skyportal/kowalski-ingester,skyportal/kowalski-api,kowalski-mongo'
dest: './logs'
- name: Upload logs
uses: actions/upload-artifact@v4
with:
name: logs
path: ./logs