Skip to content

Commit 71b3917

Browse files
PLM-197. Add QA tests to run on PRs (#128)
1 parent ab92e3b commit 71b3917

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
permissions:
3+
contents: read
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
plm_branch:
9+
description: "PLM branch"
10+
required: false
11+
tests_ver:
12+
description: "QA tests version"
13+
required: false
14+
15+
pull_request:
16+
types: [opened, reopened, synchronize, ready_for_review]
17+
branches:
18+
- main
19+
paths-ignore:
20+
- "tests/**"
21+
- "packaging/**"
22+
jobs:
23+
test:
24+
if: github.event.pull_request.draft == false
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 180
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
psmdb: ["6.0", "7.0", "8.0"]
31+
env:
32+
PLM_BRANCH: ${{ github.event_name == 'pull_request' && github.head_ref || github.event.inputs.plm_branch || 'main' }}
33+
steps:
34+
- name: Checkout testing repo
35+
uses: actions/checkout@v4
36+
with:
37+
repository: Percona-QA/psmdb-testing
38+
ref: ${{ github.event.inputs.tests_ver || 'main'}}
39+
path: psmdb-testing
40+
41+
- name: Setup environment with PSMDB ${{ matrix.psmdb }} and PLM PR/branch ${{ github.head_ref || github.event.inputs.plm_branch || env.PLM_BRANCH }}
42+
run: |
43+
MONGODB_IMAGE=perconalab/percona-server-mongodb:${{ matrix.psmdb }} docker compose build easyrsa
44+
MONGODB_IMAGE=perconalab/percona-server-mongodb:${{ matrix.psmdb }} docker compose build
45+
docker compose up -d
46+
working-directory: psmdb-testing/plm-pytest
47+
48+
- name: Test ${{ matrix.test }} sync on PSMDB ${{ matrix.psmdb }} and PLM PR/branch ${{ github.head_ref || github.event.inputs.plm_branch || env.PLM_BRANCH }}
49+
run: |
50+
docker compose run --rm test pytest -s --junitxml=junit.xml
51+
working-directory: psmdb-testing/plm-pytest
52+
53+
- name: Publish Test Report
54+
uses: mikepenz/action-junit-report@v5
55+
if: success() || failure()
56+
with:
57+
report_paths: '**/junit.xml'
58+
include_passed: True
59+
detailed_summary: True
60+
include_time_in_summary: True

0 commit comments

Comments
 (0)