forked from ethereum/staking-deposit-cli
-
Notifications
You must be signed in to change notification settings - Fork 10
110 lines (110 loc) · 3.64 KB
/
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
name: ci-runner
run-name: ${{ github.actor }} is testing and measuring code quality
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, labeled, unlabeled]
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements_test.txt
- name: Run type checker
run: python -m mypy --config-file mypy.ini -p ethstaker_deposit
- name: Run linter
run: flake8 --config=flake8.ini ./ethstaker_deposit ./tests
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: Install jsonlint
run: npm install -g @prantlf/[email protected]
- name: Validate JSON files
run: |
find ./ethstaker_deposit/intl -name "*.json" -exec jsonlint --no-duplicate-keys --quiet --compact {} \;
ci-runner:
needs: lint
if: |
contains(github.event.pull_request.labels.*.name, 'run-tests') ||
github.event_name == 'push'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm64, macos-13, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements_test.txt
- name: Run tests
run: |
coverage run --data-file=.coverage.${{ matrix.os }}.${{ matrix.python-version }} -m pytest tests
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: .coverage.${{ matrix.os }}.${{ matrix.python-version }}
retention-days: 1
if-no-files-found: error
include-hidden-files: true
coverage-combine:
needs: ci-runner
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
- name: Download coverage data
uses: actions/download-artifact@v4
- name: Merge coverage data
id: merge
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements_test.txt
coverage combine coverage*
coverage html
- name: Upload final coverage html report
uses: actions/upload-artifact@v4
id: upload-html
with:
name: coverage-html-report
path: htmlcov
- name: Generate text report
run: |
mkdir results
{
echo "Test Coverage: [Download HTML Report](${{ steps.upload-html.outputs.artifact-url }})" ;
echo ;
echo \`\`\` ;
coverage report ;
echo \`\`\` ;
} >> results/coverage-text-report
echo ${{ github.event.number }} > results/issue_number
- name: Upload final coverage text report
uses: actions/upload-artifact@v4
with:
name: results
path: results/