-
Notifications
You must be signed in to change notification settings - Fork 58
89 lines (76 loc) · 2.71 KB
/
core-test.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
80
81
82
83
84
85
86
87
88
89
name: 🌊 Ocean Core Tests
on:
pull_request:
workflow_dispatch:
jobs:
detect-changes:
uses: ./.github/workflows/detect-changes-matrix.yml
test:
name: 🌊 Ocean Core Tests
needs: detect-changes
runs-on: ubuntu-latest
if: ${{ needs.detect-changes.outputs.core == 'true' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
- name: Install dependencies
run: |
make install
- name: Unit Test Core
env:
PYTEST_ADDOPTS: --junitxml=junit/unit-test-results-ocean/core.xml
run: |
make test
- name: Build core for smoke test
run: |
make build
- name: Run fake integration for core test
env:
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }}
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }}
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }}
SMOKE_TEST_SUFFIX: ${{ github.run_id }}
run: |
./scripts/run-smoke-test.sh
- name: Smoke Test Core
env:
PYTEST_ADDOPTS: --junitxml=junit/smoke-test-results-ocean/core.xml
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }}
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }}
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }}
SMOKE_TEST_SUFFIX: ${{ github.run_id }}
run: |
make smoke/test
- name: Cleanup Smoke Test
if: always()
env:
PYTEST_ADDOPTS: --junitxml=junit/smoke-test-results-ocean/core.xml
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }}
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }}
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }}
SMOKE_TEST_SUFFIX: ${{ github.run_id }}
run: |
make smoke/clean
- name: Install current core for all integrations
run: |
echo "Installing local core for all integrations"
SCRIPT_TO_RUN='make install/local-core' make execute/all
- name: Test all integrations with current core
run: |
echo "Testing all integrations with local core"
SCRIPT_TO_RUN="PYTEST_ADDOPTS=--junitxml=${PWD}/junit/test-results-core-change/\`pwd | xargs basename\`.xml make test" make execute/all
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: ${{ always() }}
with:
report_paths: '**/junit/**-test-results-**/*.xml'
include_passed: true
require_tests: true
fail_on_failure: true