-
Notifications
You must be signed in to change notification settings - Fork 29
45 lines (42 loc) · 1.12 KB
/
local-api-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
# Execute API tests in tests/ with server.py running locally
name: Local API Tests
on:
push:
paths:
- server.py
- requirements.txt
- db/**/*
- src/*
- tests/**/*
- setup.sh
pull_request:
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.11.9'
cache: pip
- name: Install app requirements
run: pip install -r requirements.txt
- name: Clone v2-src
run: git clone https://github.com/gadhagod/Hyrule-Compendium-API -b v2-src v2
- name: Start server
run: python3 -c "from server import app; app.run()" ${{ secrets.RS2_TOKEN }} &
- name: Install test dependencies
run: |
cd tests
npm i
- name: Execute tests
run: |
cd tests
env URL="http://127.0.0.1:5000" npx mocha
env:
MONGO_PASSWORD: ${{ secrets.MONGO_PASSWORD }}
MONGO_USERNAME: ${{ secrets.MONGO_USERNAME }}