Skip to content

valefar-on-discord is running ci-runner #377

valefar-on-discord is running ci-runner

valefar-on-discord is running ci-runner #377

Workflow file for this run

name: ci-runner
run-name: ${{ github.actor }} is running ci-runner
on:
push:
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_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/jsonlint
- name: Validate JSON files
run: |
for file in $(find ./ethstaker_deposit/intl -name "*.json"); do
jsonlint --no-duplicate-keys --quiet --compact $file
done
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.0-rc.2"]
exclude:
- os: ubuntu-24.04-arm64
python-version: "3.13.0-rc.2"
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_test.txt
pip install coverage
- 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: Download coverage data
uses: actions/download-artifact@v4
- name: Merge coverage data
id: merge
run: |
python -m pip install --upgrade pip
pip install coverage
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 }})" >> results/coverage-text-report
echo >> results/coverage-text-report
echo \`\`\` >> results/coverage-text-report
coverage report >> results/coverage-text-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/