45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: Unit test
|
|
on: [workflow_call]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Get pip cache dir
|
|
id: pip-cache
|
|
run: |
|
|
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
|
|
- name: pip cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.cfg') }}
|
|
- name: Update pip
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
- name: Install project dependencies
|
|
run: |
|
|
pip install -r requirements-dev.txt
|
|
pip install pytest-cov
|
|
pip install pytest-github-actions-annotate-failures
|
|
- name: Test with pytest
|
|
run: |
|
|
make test-only
|
|
- name: "Upload coverage to Codecov"
|
|
if: ${{ github.repository == 'getmoto/moto'}}
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
fail_ci_if_error: false
|
|
flags: unittests |