move contact email to action variables #575
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push, pull_request] | |
jobs: | |
test_pre38: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: [ 3.6, 3.7 ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt -r requirements_pre38.txt responses | |
- name: Test | |
run: python -m unittest discover | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- python_version: "3.8" | |
- python_version: "3.9" | |
- python_version: "3.10" | |
- python_version: "3.11" | |
- python_version: "3.12" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt responses coverage | |
- name: Test | |
run: coverage run --rcfile=.coveragerc -m unittest discover | |
env: | |
COVERAGE_FILE: ".coverage.${{ matrix.python_version }}" | |
- name: Store coverage file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-${{ matrix.python_version }} | |
path: .coverage.${{ matrix.python_version }} | |
if-no-files-found: error | |
include-hidden-files: true | |
coverage: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
id: download | |
with: | |
path: '.' | |
pattern: 'coverage-*' | |
merge-multiple: true | |
- name: Coverage comment | |
id: coverage_comment | |
uses: ewjoachim/python-coverage-comment-action@v3 | |
with: | |
GITHUB_TOKEN: ${{ github.token }} | |
MERGE_COVERAGE_FILES: true | |
VERBOSE: true | |
- name: Store Pull Request comment to be posted | |
uses: actions/upload-artifact@v4 | |
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true' | |
with: | |
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly | |
name: python-coverage-comment-action | |
# If you use a different name, update COMMENT_FILENAME accordingly | |
path: python-coverage-comment-action.txt | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt pylint coverage coveralls | |
- name: Lint with PyLint | |
run: | | |
pylint --rcfile=pylint.rc osctiny |