Skip to content

Commit b511a12

Browse files
committed
Add CI workflows + updates for Codecov CI integration and README badges
1 parent b08b21c commit b511a12

4 files changed

Lines changed: 203 additions & 13 deletions

File tree

.github/FUNDING.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# These are supported funding model platforms
2+
3+
github: sr-murthy
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# This workflow is designed to lint and test source code against multiple
2+
# combinations of Python version, OS, and hardware architecture.
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: ${{ github.event.number || github.run_id }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
env:
24+
PYTHONDEVMODE: 1
25+
API_USERNAME: ${{ secrets.API_USERNAME }}
26+
API_KEY: ${{ secrets.API_KEY }}
27+
runs-on: ${{ matrix.os }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
python-version: ["3.13"]
32+
os: [ubuntu-latest, macos-latest, windows-latest]
33+
install-via: [pip]
34+
arch: [x64]
35+
include:
36+
- python-version: "3.13"
37+
os: macos-latest
38+
install-via: pip
39+
arch: arm64
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
architecture: ${{ matrix.arch }}
49+
allow-prereleases: false
50+
51+
- name: Set Variables
52+
id: set_variables
53+
shell: bash
54+
run: |
55+
echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_OUTPUT
56+
echo "PIP_CACHE=$(pip cache dir)" >> $GITHUB_OUTPUT
57+
58+
- name: Cache pip
59+
uses: actions/cache@v4
60+
with:
61+
path: ${{ steps.set_variables.outputs.PIP_CACHE }}
62+
key: ${{ runner.os }}-pip-${{ steps.set_variables.outputs.PY }}
63+
64+
- name: Cache venv
65+
uses: actions/cache@v4
66+
with:
67+
path: .venv
68+
key: venv-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}-${{ hashFiles('pdm.lock') }}
69+
restore-keys: |
70+
venv-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}-
71+
72+
- name: Install current PDM via pip
73+
if: matrix.install-via == 'pip'
74+
run: |
75+
python -m pip install pdm
76+
pdm info -v
77+
78+
- name: Lint + Run unit & acceptance tests + Measure code coverage
79+
run: |
80+
pdm use -f .venv
81+
pdm install -v
82+
pdm run -v lint
83+
pdm run -v pytest
84+
pdm run -v doctests
85+
86+
- name: Upload coverage reports to Codecov
87+
uses: codecov/codecov-action@v5
88+
with:
89+
slug: sr-murthy/financial_services_register_api
90+
files: ./coverage.xml
91+
flags: unit
92+
verbose: true
93+
env:
94+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/codeql.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
branches: [ "main" ]
19+
20+
jobs:
21+
analyze:
22+
name: Analyze
23+
# Runner size impacts CodeQL analysis time. To learn more, please see:
24+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
25+
# - https://gh.io/supported-runners-and-hardware-resources
26+
# - https://gh.io/using-larger-runners
27+
# Consider using larger runners for possible analysis time improvements.
28+
runs-on: ${{ (matrix.language == 'python' && ('macos-13' || 'macos-latest' || 'ubuntu-latest' || 'window-latest')) }}
29+
timeout-minutes: ${{ (matrix.language == 'python' && 120) || 360 }}
30+
permissions:
31+
# required for all workflows
32+
security-events: write
33+
34+
# only required for workflows in private repositories
35+
actions: read
36+
contents: read
37+
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
language: [ 'python' ]
42+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
43+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
44+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
45+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
51+
# Initializes the CodeQL tools for scanning.
52+
- name: Initialize CodeQL
53+
uses: github/codeql-action/init@v3
54+
with:
55+
languages: ${{ matrix.language }}
56+
# If you wish to specify custom queries, you can do so here or in a config file.
57+
# By default, queries listed here will override any specified in a config file.
58+
# Prefix the list here with "+" to use these queries and those in the config file.
59+
60+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
61+
# queries: security-extended,security-and-quality
62+
63+
64+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
65+
# If this step fails, then you should remove it and run the build manually (see below)
66+
- name: Autobuild
67+
uses: github/codeql-action/autobuild@v3
68+
69+
# ℹ️ Command-line programs to run using the OS shell.
70+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
71+
72+
# If the Autobuild fails above, remove it and uncomment the following three lines.
73+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
74+
75+
# - run: |
76+
# echo "Run, Build Application using script"
77+
# ./location_of_script_within_repo/buildscript.sh
78+
79+
- name: Perform CodeQL Analysis
80+
uses: github/codeql-action/analyze@v3
81+
with:
82+
category: "/language:${{matrix.language}}"

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
<div align="center">
22

3-
[![CI](https://github.com/sr-murthy/fs-register-api-client/actions/workflows/ci.yml/badge.svg)](https://github.com/sr-murthy/fs-register-api-client/actions/workflows/ci.yml)
4-
[![CodeQL](https://github.com/sr-murthy/fs-register-api-client/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/sr-murthy/fs-register-api-client/actions/workflows/codeql-analysis.yml)
5-
[![codecov](https://codecov.io/github/sr-murthy/fs-register-api-client/graph/badge.svg?token=F41VZIHT2K)](https://codecov.io/github/sr-murthy/fs-register-api-client)
3+
[![CI](https://github.com/sr-murthy/financial-services-register-api/actions/workflows/ci.yml/badge.svg)](https://github.com/sr-murthy/financial-services-register-api/actions/workflows/ci.yml)
4+
[![CodeQL](https://github.com/sr-murthy/financial-services-register-api/actions/workflows/codeql.yml/badge.svg)](https://github.com/sr-murthy/financial-services-register-api/actions/workflows/codeql.yml)
5+
[![codecov](https://codecov.io/github/sr-murthy/financial-services-register-api/graph/badge.svg?token=QUA73GJ6HF)](https://codecov.io/github/sr-murthy/financial-services-register-api)
66
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
77
[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm-project.org)
88
[![License: MPL
99
2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
10-
[![Docs](https://readthedocs.org/projects/fs-register-api-client/badge/?version=latest)](https://fs-register-api-client.readthedocs.io/en/latest/?badge=latest)
10+
[![Docs](https://readthedocs.org/projects/financial-services-register-api/badge/?version=latest)](https://financial-services-register-api.readthedocs.io/en/latest/?badge=latest)
1111
<a href="https://trackgit.com">
1212
<img src="https://us-central1-trackgit-analytics.cloudfunctions.net/token/ping/m45fbfbm6zgkqmfudv6m" alt="trackgit-views" />
1313
</a>
14-
[![PyPI version](https://img.shields.io/pypi/v/fs-register-api-client?logo=python&color=41bb13)](https://pypi.org/project/fs-register-api-client)
15-
![PyPI Downloads](https://static.pepy.tech/badge/fs-register-api-client)
14+
[![PyPI version](https://img.shields.io/pypi/v/financial-services-register-api?logo=python&color=41bb13)](https://pypi.org/project/financial-services-register-api)
15+
![PyPI Downloads](https://static.pepy.tech/badge/financial-services-register-api)
1616

1717
</div>
1818

19-
# fs-register-api-client
19+
# financial-services-register-api
2020

2121
A lightweight Python client library for the UK [Financial Services Register](https://register.fca.org.uk/s/) [RESTful API](https://register.fca.org.uk/Developer/s/).
2222

23-
The [PyPI package](https://pypi.org/project/fs-register-api-client) is currently at version `0.5.1`.
23+
The [PyPI package](https://pypi.org/project/financial-services-register-api) is currently at version `0.5.1`.
2424

2525
The Financial Services Register, or FS Register, is a **public** database of all firms, individuals, funds, and other entities, that are either currently, or have been previously, authorised and/or regulated by the UK [Financial Conduct Authority (FCA)](https://www.fca.org.uk) and/or the [Prudential Regulation Authority (PRA)](http://bankofengland.co.uk/pra).
2626

2727
> [!NOTE]
2828
> The FS Register API is free to use but accessing it, including via this library, requires [registration](https://register.fca.org.uk/Developer/ShAPI_LoginPage?ec=302&startURL=%2FDeveloper%2Fs%2F#). Registration involves a free sign up with an email, which is used as the API username in requests, and basic personal information. Once registered an API key is available from your registration profile.
2929
30-
See the [Sphinx documentation](https://fs-register-api-client.readthedocs.io) for more details on:
30+
See the [Sphinx documentation](https://financial-services-register-api.readthedocs.io) for more details on:
3131

32-
* [understanding the FS Register API](https://fs-register-api-client.readthedocs.io/sources/fs-register-api.html)
33-
* [usage](https://fs-register-api-client.readthedocs.io/sources/usage.html)
34-
* [contributing](https://fs-register-api-client.readthedocs.io/sources/contributing.html)
35-
* [API reference](https://fs-register-api-client.readthedocs.io/sources/api-reference.html)
32+
* [understanding the FS Register API](https://financial-services-register-api.readthedocs.io/sources/fs-register-api.html)
33+
* [usage](https://financial-services-register-api.readthedocs.io/sources/usage.html)
34+
* [contributing](https://financial-services-register-api.readthedocs.io/sources/contributing.html)
35+
* [API reference](https://financial-services-register-api.readthedocs.io/sources/api-reference.html)

0 commit comments

Comments
 (0)