replace datetime.utcfromtimestamp #6
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: python-unit-tests | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
build-pyauditor: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./pyauditor | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build pyauditor wheel from repo | |
run: | | |
pip install --upgrade pip | |
pip wheel . | |
- name: Upload pyauditor wheel | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pyauditor-wheel-${{ matrix.python-version }} | |
path: pyauditor/*.whl | |
retention-days: 7 | |
unit-tests-apel-plugin: | |
runs-on: ubuntu-latest | |
needs: build-pyauditor | |
defaults: | |
run: | |
working-directory: ./plugins/apel | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Download pyauditor wheel | |
uses: actions/download-artifact@v3 | |
with: | |
name: pyauditor-wheel-${{ matrix.python-version }} | |
path: ./plugins/apel | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install *.whl | |
pip install -e .[tests] | |
- name: Run pytest | |
run: pytest | |
- name: Upload coverage as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lcov-${{ matrix.python-version }}.info | |
path: ./plugins/apel/lcov.info | |
retention-days: 7 | |
upload-coverage: | |
runs-on: ubuntu-latest | |
needs: unit-tests-apel-plugin | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Download coverage artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: lcov-${{ matrix.python-version }}.info | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: lcov.info | |
fail_ci_if_error: true |