Merge pull request #88 from sandialabs/dependabot/github_actions/gith… #178
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
egress-policy: audit | |
- name: Check out the commit | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up Python | |
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 | |
with: | |
python-version: ~${{ matrix.version }} | |
- name: Install development dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install \ | |
-r requirements.txt \ | |
-r doc/requirements.txt \ | |
-r example/requirements.txt \ | |
-r test/requirements.txt | |
- name: Test install | |
run: python3 -m pip install . | |
- name: Test with pytest | |
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: python3 -m pytest --verbose --cov=shell_logger test/ | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Check documentation coverage | |
run: | | |
make coverage SPHINXOPTS="-W --keep-going" | |
mv build/coverage/python.txt ../docs-coverage-report-${{ matrix.version }}.txt | |
working-directory: ./doc | |
- name: Archive documentation coverage results | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
name: docs-coverage-report-${{ matrix.version }} | |
path: docs-coverage-report-${{ matrix.version }}.txt | |
- name: Test uninstall | |
run: python3 -m pip uninstall -y shell-logger | |
commits: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
egress-policy: audit | |
- name: Conventional Commits | |
uses: taskmedia/action-conventional-commits@866c0e6dba6aaaef9ad0939a40620b27888906c2 # v1.1.17 | |
with: | |
types: > | |
build|chore|ci|docs|feat|fix|minor|patch|perf|style|refactor|test |