no message #8
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: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
permissions: | ||
checks: write | ||
jobs: | ||
pre-commit: | ||
name: Pre-commit checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/[email protected] | ||
- name: Pre-commit checks | ||
uses: pre-commit/[email protected] | ||
env: | ||
SKIP: no-commit-to-branch | ||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build-id: ${{ steps.generate-build-id.outputs.build-id }} | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/[email protected] | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: cache poetry install | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.local | ||
key: poetry-1.1.12-0 | ||
- name: Install and configure Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.4.0 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: false | ||
installer-parallel: true | ||
- name: cache deps | ||
id: cache-deps | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: pydeps-${{ hashFiles('**/poetry.lock') }} | ||
# Install dependencies. `--no-root` means "install all dependencies but not the project | ||
# itself", which is what you want to avoid caching _your_ code. The `if` statement | ||
# ensures this only runs on a cache miss. | ||
- run: poetry install --no-interaction --no-root | ||
if: steps.cache-deps.outputs.cache-hit != 'true' | ||
- run: poetry install --no-interaction | ||
- name: test | ||
run: | | ||
poetry run pytest --cov=pydiction --cov-report=xml:coverage.xml --junitxml=test-results/test-results.xml tests | ||
- name: Test Report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: success() || failure() | ||
with: | ||
report_paths: '**/test-results/*.xml' | ||
- name: Coverage Report | ||
uses: 5monkeys/cobertura-action@master | ||
if: success() || failure() | ||
with: | ||
path: coverage.xml | ||
minimum_coverage: 75 | ||
fail_below_threshold: true | ||
build: | ||
if: github.ref == 'refs/heads/main' | ||
needs: | ||
- test | ||
runs-on: ubuntu-latest | ||
concurrency: build | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Python Semantic Release | ||
uses: python-semantic-release/python-semantic-release@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v3 | ||
if: steps.build.outputs.released == 'true' | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
outputs: | ||
released: steps.build.outputs.released | ||
release: | ||
if: job.build.outputs.released == 'true' | ||
Check failure on line 123 in .github/workflows/ci.yml GitHub Actions / CIInvalid workflow file
|
||
concurrency: release | ||
needs: | ||
- pre-commit | ||
- build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ |