-
Notifications
You must be signed in to change notification settings - Fork 9
58 lines (40 loc) · 1.73 KB
/
integrate.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
name: Run Integration Tests
on: push
jobs:
integrate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Disable Container Mount
run: "cat docker-compose.yml | tr '\\n' '\\r' | sed -e 's/ volumes:\\r - .:\\/app/ working_dir: \\/app\\/src\\//' | tr '\\r' '\\n' | tee docker-compose.yml.new && mv docker-compose.yml{.new,}"
- name: Set Docker-Compose to Upstream
run: "sed -i 's/build: \\./image: ghcr.io\\/ractf\\/core:latest/' docker-compose.yml"
- name: Start Upstream Container
run: make dev-server
- name: Wait for Upstream to Boot
run: sleep 10
- name: Generate Test Fixtures
run: docker exec -w /app --tty $(docker-compose ps -q backend) make fake-data ARGS="--teams 10 --users 2 --categories 10 --challenges 100 --solves 1000 --zoom"
- name: Confirm Upstream is Healthy
run: curl -v --fail localhost:8000/api/v2/stats/stats/
- name: Shut Down Upstream
run: docker-compose rm -sf
- name: Swap to Current branch
run: "sed -i 's/image: ghcr.io\\/ractf\\/core:latest/build: \\./' docker-compose.yml"
- name: Confirm Current Docker Compose
run: cat docker-compose.yml
- name: Start Current Container
run: make dev-server
- name: Wait for Current to Boot
run: sleep 10
- name: Confirm Current is Healthy
run: curl -v --fail localhost:8000/api/v2/stats/stats/
- name: Get Core Logs
run: docker-compose logs backend
if: always()
- name: Get Sockets Logs
run: docker-compose logs sockets
if: always()
- name: Clean Up Docker Compose
run: make clean-dev-server