-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit * refactor: rename to check-check * feat: add minimal and doctests jobs * Bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * initial commit * fix: adjust names * fix: make code more mergeable * ci: fix so that nightly uses 3.13-dev * ci: fix typo * ci: add concurreny to test * ci: prepare CI/Makefile rework * build: use pdm export * build: ignore .pdm stuff * build: use pdm instead of rye * build: add orjson to export command * ci(scheduled): install pdm separate * ci: add json-lib --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0712b50
commit cee1127
Showing
13 changed files
with
1,165 additions
and
497 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Github config and workflows | ||
|
||
In this folder there is configuration for codecoverage, dependabot and ci workflows. | ||
|
||
This folder can be merged using a `--allow-unrelated-histories` merge strategy from <https://github.com/spraakbanken/python-pdm-ci-conf> which provides a reasonably sensible base for writing your own ci on. By using this strategy the history of the CI repo is included in your repo, and future updates to the CI can be merged later. | ||
|
||
The workflows in this folder requires a root Makefile with a couple of targets defined. | ||
As base can the Makefile in <https://github.com/spraakbanken/python-pdm-make-conf> be used. | ||
|
||
To perform this merge run: | ||
|
||
```shell | ||
git remote add ci [email protected]:spraakbanken/python-pdm-ci-conf.git | ||
git fetch ci | ||
git merge --allow-unrelated-histories ci/main | ||
``` | ||
|
||
or add the remote as `git remote add ci https://github.com/spraakbanken/python-pdm-ci-conf.git` | ||
|
||
To later merge updates to this repo, just run: | ||
|
||
```shell | ||
git fetch ci | ||
get merge ci/main | ||
``` | ||
|
||
This setup is inspired by <https://github.com/jonhoo/rust-ci-conf>. |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# ref: https://docs.codecov.com/docs/codecovyml-reference | ||
coverage: | ||
# Hold ourselves to a high bar | ||
range: 85..100 | ||
round: down | ||
precision: 1 | ||
status: | ||
# ref: https://docs.codecov.com/docs/commit-status | ||
project: | ||
default: | ||
# Avoid false negatives | ||
threshold: 1% | ||
|
||
# Test files aren't important for coverage | ||
ignore: | ||
- "tests" | ||
|
||
# Make comments less noisy | ||
comment: | ||
layout: "files" | ||
require_changes: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
merge_group: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
MINIMUM_PYTHON_VERSION: "3.9" | ||
|
||
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that | ||
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
name: ubuntu / fmt | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up the python ${{ env.MINIMUM_PYTHON_VERSION }} | ||
uses: pdm-project/setup-pdm@v4 | ||
id: setup-python | ||
with: | ||
python-version: ${{ env.MINIMUM_PYTHON_VERSION }} | ||
|
||
- name: Load cached venv | ||
id: cached-venv | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/check.yml') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-venv.outputs.cache-hit != 'true' | ||
run: make install-dev-orjson | ||
|
||
- name: check formatting | ||
run: make check-fmt | ||
lint: | ||
runs-on: ubuntu-latest | ||
name: ubuntu / lint | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up the python ${{ env.MINIMUM_PYTHON_VERSION }} | ||
uses: pdm-project/setup-pdm@v4 | ||
id: setup-python | ||
with: | ||
python-version: ${{ env.MINIMUM_PYTHON_VERSION }} | ||
- name: Load cached venv | ||
id: cached-venv | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/check.yml') }} | ||
- name: Install dependencies | ||
if: steps.cached-venv.outputs.cache-hit != 'true' | ||
run: make install-dev-orjson | ||
- name: lint code | ||
run: make lint | ||
type-check: | ||
runs-on: ubuntu-latest | ||
name: ubuntu / type-check | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up the python ${{ env.MINIMUM_PYTHON_VERSION }} | ||
uses: pdm-project/setup-pdm@v4 | ||
id: setup-python | ||
with: | ||
python-version: ${{ env.MINIMUM_PYTHON_VERSION }} | ||
- name: Load cached venv | ||
id: cached-venv | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('.github/workflows/check.yml') }} | ||
- name: Install dependencies | ||
if: steps.cached-venv.outputs.cache-hit != 'true' | ||
run: make install-dev-orjson | ||
- name: type-check code | ||
run: make lint | ||
|
||
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks | ||
check-check: | ||
if: always() | ||
needs: | ||
- fmt | ||
- lint | ||
- type-check | ||
runs-on: ubuntu-latest | ||
permissions: {} | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
allowed-failures: upload-coverage |
Oops, something went wrong.