Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub workflows #4

Merged
merged 5 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
35 changes: 29 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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+.

Expand Down