-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.26 KB
/
oracle-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
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
73
74
75
76
77
78
79
name: Oracle Tests
on:
workflow_call:
env:
DEFAULT_PYTHON: '3.12'
jobs:
tests:
name: Run Oracle tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache jars
uses: actions/cache@v4
with:
path: ./cached_jars
key: ${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-test-oracle
restore-keys: |
${{ runner.os }}-python-${{ env.DEFAULT_PYTHON }}-test-oracle
${{ runner.os }}-python-
- name: Build Worker Image
uses: docker/build-push-action@v6
with:
context: .
tags: mtsrus/syncmaster-worker:${{ github.sha }}
target: test
file: docker/Dockerfile.worker
load: true
cache-from: mtsrus/syncmaster-worker:develop
- name: Docker compose up
run: |
docker compose -f docker-compose.test.yml --profile all down -v --remove-orphans
docker compose -f docker-compose.test.yml --profile oracle up -d --wait --wait-timeout 200
env:
WORKER_IMAGE_TAG: ${{ github.sha }}
- name: Run Oracle Tests
run: |
docker compose -f ./docker-compose.test.yml --profile oracle exec -T worker coverage run -m pytest -vvv -s -m "worker and oracle"
- name: Dump worker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
images: mtsrus/syncmaster-worker
dest: ./logs
# This is important, as coverage is exported after receiving SIGTERM
- name: Shutdown
if: always()
run: |
docker compose -f docker-compose.test.yml --profile all down -v --remove-orphans
- name: Upload worker logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: worker-logs-oracle
path: logs/*
- name: Upload coverage results
uses: actions/upload-artifact@v4
with:
name: coverage-oracle
path: reports/*
# https://github.com/actions/upload-artifact/issues/602
include-hidden-files: true