Restructure experiment folder (#3) #27
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: Pytest CI/CD | |
on: [push] | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Python dependencies | |
id: cache-pip | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-python-dependencies | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements_dev.txt') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements_dev.txt | |
pip install genbadge[all] | |
- name: Test with pytest | |
run: | | |
pytest --ignore=test/availability | |
- name: Generate badge | |
run: | | |
genbadge tests -i junit.xml -o pytest.svg | |
genbadge coverage -i coverage.xml -o coverage.svg | |
- name: Upload tests badge as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pytest | |
path: pytest.svg | |
- name: Upload coverage badge as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage | |
path: coverage.svg | |
flake8: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 genbadge[all] | |
- name: Lint with flake8 | |
run: | | |
flake8 --exit-zero --output-file flake8.txt | |
- name: Generate badge | |
run: | | |
genbadge flake8 -i flake8.txt -o flake8.svg | |
- name: Upload badge with GitHub pages | |
uses: actions/upload-artifact@v2 | |
with: | |
name: flake8 | |
path: flake8.svg |