Bump libs #349
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: Pre-build Checks & Tests | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: [main, v/*] | |
jobs: | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
allow-prereleases: true | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Dependencies | |
run: | | |
pip install --upgrade pip | |
pip install --no-cache-dir "poetry==1.8.3" | |
poetry install --no-root --no-interaction --no-ansi --without docs | |
- name: Execute Tests | |
run: poetry run task tests | |
- name: Rename file | |
env: | |
VER: ${{ matrix.python }} | |
run: mv ./coverage.xml ./coverage-$VER.xml | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-${{ matrix.python }}.xml | |
path: coverage-${{ matrix.python }}.xml | |
- name: Coveralls | |
uses: coverallsapp/[email protected] | |
with: | |
coverage-reporter-version: v0.6.14 | |
file: coverage-${{ matrix.python }}.xml | |
lint: | |
name: Code Lint | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
allow-prereleases: true | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Dependencies | |
run: | | |
pip install --upgrade pip | |
pip install --no-cache-dir "poetry==1.8.3" | |
poetry install --no-root --no-interaction --no-ansi --without docs | |
- name: Run ruff | |
run: poetry run task ruff-lint | |
- name: Run mypy | |
run: poetry run task mypy-lint | |
- name: Run poetry check | |
run: poetry run task poetry-check | |
- name: Run pip check | |
run: poetry run task pip-check | |
sonar: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
needs: unit-tests | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- uses: actions/download-artifact@v4 | |
with: | |
name: coverage-3.13.xml | |
- name: Rename file | |
run: mv ./coverage{-3.13,}.xml | |
- name: Fix code coverage paths | |
run: | | |
sed -i 's/\/home\/runner\/work\/py-cachify\/py-cachify\//\/github\/workspace\//g' /home/runner/work/py-cachify/py-cachify/coverage.xml | |
cat /home/runner/work/py-cachify/py-cachify/coverage.xml | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |