-
Notifications
You must be signed in to change notification settings - Fork 73
111 lines (96 loc) · 3.89 KB
/
coverage_runner.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Run tests, measure coverage and upload results to codecov
on:
workflow_dispatch:
inputs:
pr_number:
description: Enter PR number coming from community to run coverage on it. Do not run for PR coming from hazelcast organization, they will be run automatically.
required: true
push:
branches:
- master
- '[45].*.z'
pull_request_target:
branches:
- master
- '[45].*.z'
jobs:
check_for_membership:
runs-on: ubuntu-latest
name: Check membership of given user
outputs:
check-result: ${{ steps.composite.outputs.check-result }}
steps:
- name: Action for membership check
id: composite
uses: hazelcast/hazelcast-tpm/membership@main
with:
organization-name: 'hazelcast'
member-name: ${{ github.event.pull_request.head.repo.owner.login }}
token: ${{ secrets.PAT }}
run-tests:
runs-on: ${{ matrix.os }}
needs: [check_for_membership]
if: github.event_name == 'push' || needs.check_for_membership.outputs.check-result == 'true' || github.event_name == 'workflow_dispatch'
name: Run tests with Python ${{ matrix.python-version }} on ${{ matrix.os }}
strategy:
matrix:
python-version: [ '3.7', '3.12' ]
os: [ ubuntu-20.04, windows-latest ]
fail-fast: false
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout code for PR
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Checkout repository for push event
if: github.event_name == 'push'
uses: actions/checkout@v2
- name: Checkout PR coming from community.
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.inputs.pr_number }}/merge
- name: Install dependencies
run: |
pip install -r requirements-test.txt
- name: Run tests
env:
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY_V7 }}
HZ_SNAPSHOT_INTERNAL_USERNAME: ${{ secrets.HZ_SNAPSHOT_INTERNAL_USERNAME }}
HZ_SNAPSHOT_INTERNAL_PASSWORD: ${{ secrets.HZ_SNAPSHOT_INTERNAL_PASSWORD }}
run: python run_tests.py
- name: Publish results to Codecov for PR coming from hazelcast organization
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-20.04' && github.event_name == 'pull_request_target' }}
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
override_pr: ${{ github.event.pull_request.number }}
- name: Publish results to Codecov for Push
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-20.04' && github.event_name == 'push' }}
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
- name: Publish result to Codecov for PR coming from community
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-20.04' && github.event_name == 'workflow_dispatch' }}
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
override_pr: ${{ github.event.inputs.pr_number }}
- name: Upload remote controller logs if test run fails
uses: actions/upload-artifact@v4
if: failure()
with:
name: rc-logs-${{ matrix.python-version }}-${{ matrix.os }}
path: |
rc_stderr.log
rc_stdout.log