diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index d2025bb..4519cc7 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -2,9 +2,9 @@ name: pre-commit action on: pull_request: - # Run on merge to main because caches are inherited from parent branches push: branches: + # Run on merge to main because caches are inherited from parent branches - main env: # This should be the default but we'll be explicit @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ['3.10'] + python_version: ['3.11'] steps: - name: Checkout Code uses: actions/checkout@v3 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a866c02..4c3591f 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -2,13 +2,10 @@ name: unit-test action on: pull_request: - # Run on merge to main because caches are inherited from parent branches push: branches: + # Run on merge to main because caches are inherited from parent branches - main -env: - # This should be the default but we'll be explicit - PRE_COMMIT_HOME: ~/.caches/pre-commit jobs: two_job: runs-on: ubuntu-latest @@ -31,11 +28,32 @@ jobs: shell: bash run: | python tests/test_generate_nhs_numbers.py + three_six_job: + # Later versions don't support Python 3.6 + runs-on: ubuntu-20.04 + strategy: + matrix: + python_version: ['3.6'] + steps: + - name: Checkout Code + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + - name: Install package + shell: bash + run: | + python -m pip install . + - name: Run tests + shell: bash + run: | + python tests/test_generate_nhs_numbers.py three_job: runs-on: ubuntu-latest strategy: matrix: - python_version: ['3.6'] + python_version: ['3.7', '3.8', '3.9', '3.10'] steps: - name: Checkout Code uses: actions/checkout@v3 @@ -55,7 +73,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: ['3.7'] + python_version: ['3.11'] steps: - name: Checkout Code uses: actions/checkout@v3 @@ -73,3 +91,8 @@ jobs: run: | python -m coverage run --source nhs_number_generator tests/test_generate_nhs_numbers.py python -m coverage report --show-missing + python -m coverage lcov + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v2 + with: + path-to-lcov: "./coverage.lcov" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 54f25de..bdfcec5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,23 +3,23 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/markdownlint/markdownlint - rev: v0.11.0 + rev: v0.12.0 hooks: - id: markdownlint args: [--style=mdl_style.rb] - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/PyCQA/flake8 diff --git a/README.md b/README.md index a9096b6..0825b88 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # NHS Number Generator [![Coverage Status](https://coveralls.io/repos/github/Iain-S/nhs_number_generator/badge.svg?branch=master)](https://coveralls.io/github/Iain-S/nhs_number_generator?branch=master) -[![Build Status](https://travis-ci.org/Iain-S/nhs_number_generator.svg?branch=master)](https://travis-ci.org/Iain-S/nhs_number_generator) Generate and validate NHS numbers in Python 2.7+ and 3.6+.