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

ci/lint: update configs #34

Merged
merged 4 commits into from
Sep 17, 2024
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
7 changes: 3 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Validation check:
# $ curl --data-binary @.codecov.yml https://codecov.io/validate


# https://docs.codecov.io/docs/codecovyml-reference
codecov:
bot: "codecov-io"
Expand All @@ -13,7 +12,7 @@ codecov:
wait_for_ci: yes

coverage:
precision: 0 # 2 = xx.xx%, 0 = xx%
precision: 0 # 2 = xx.xx%, 0 = xx%
round: nearest # how coverage is rounded: down/up/nearest
range: 40...100 # custom range of coverage colors from red -> yellow -> green
status:
Expand All @@ -32,7 +31,7 @@ coverage:

# https://docs.codecov.com/docs/github-checks#disabling-github-checks-patch-annotations
github_checks:
annotations: false
annotations: false

parsers:
gcov:
Expand All @@ -47,5 +46,5 @@ parsers:
comment:
layout: header, diff
require_changes: true
behavior: default # update if exists else create new
behavior: default # update if exists else create new
# branches: *
2 changes: 0 additions & 2 deletions .github/labeler.yml

This file was deleted.

45 changes: 22 additions & 23 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,67 @@
pull_request_rules:

- name: warn on conflicts
conditions:
- conflict
- -draft # filter-out GH draft PRs
- -draft # filter-out GH draft PRs
- -label="has conflicts"
actions:
# comment:
# message: This pull request is now in conflict... :(
label:
add: [ "has conflicts" ]
add: ["has conflicts"]

- name: resolved conflicts
conditions:
- -conflict
- label="has conflicts"
- -draft # filter-out GH draft PRs
- -merged # not merged yet
- -draft # filter-out GH draft PRs
- -merged # not merged yet
- -closed
actions:
label:
remove: [ "has conflicts" ]
remove: ["has conflicts"]

- name: update PR
conditions:
- -conflict
- -draft # filter-out GH draft PRs
- -draft # filter-out GH draft PRs
#- base=main # apply only on master
- -title~=(?i)wip # skip all PR that title contains “WIP” (ignoring case)
- -title~=(?i)wip # skip all PR that title contains “WIP” (ignoring case)
- "#approved-reviews-by>=1" # number of review approvals
actions:
update: {}

- name: Ready to Go
conditions:
- -conflict
- -draft # filter-out GH draft PRs
- -title~=(?i)wip # skip all PR that title contains “WIP” (ignoring case)
- "#approved-reviews-by>=1" # number of review approvals
- "#changes-requested-reviews-by=0" # no requested changes
- -draft # filter-out GH draft PRs
- -title~=(?i)wip # skip all PR that title contains “WIP” (ignoring case)
- "#approved-reviews-by>=1" # number of review approvals
- "#changes-requested-reviews-by=0" # no requested changes
- "#check-pending<=1"
- "#check-failure<2"
actions:
label:
add: [ "0:] Ready-To-Go" ]
add: ["0:] Ready-To-Go"]

- name: Not ready yet
conditions:
- or:
- draft # filter-out GH draft PRs
- title~=(?i)wip # skip all PR that title contains “WIP” (ignoring case)
- "#approved-reviews-by=0" # number of review approvals
- "#changes-requested-reviews-by>=1" # no requested changes
- "#check-failure>=3"
- draft # filter-out GH draft PRs
- title~=(?i)wip # skip all PR that title contains “WIP” (ignoring case)
- "#approved-reviews-by=0" # number of review approvals
- "#changes-requested-reviews-by>=1" # no requested changes
- "#check-failure>=3"
actions:
label:
remove: [ "0:] Ready-To-Go" ]
remove: ["0:] Ready-To-Go"]

- name: add reviewer
conditions:
- -conflict # skip if conflict
- -draft # filter-out GH draft PRs
- "#approved-reviews-by<1" # number of review approvals
- "#review-requested<1" # number of requested reviews
- -conflict # skip if conflict
- -draft # filter-out GH draft PRs
- "#approved-reviews-by<1" # number of review approvals
- "#review-requested<1" # number of requested reviews
actions:
request_reviews:
users:
Expand Down
89 changes: 44 additions & 45 deletions .github/workflows/ci_pkg-install.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Install package

# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
on: # Trigger the workflow on push or pull request, but only for the main branch
push:
branches: [main]
pull_request: {}
Expand All @@ -18,65 +18,64 @@ jobs:
pkg-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Check package
run: |
pip install check-manifest
check-manifest
python setup.py check --metadata --strict
- name: Check package
run: |
pip install check-manifest
check-manifest
python setup.py check --metadata --strict

- name: Create package
run: |
pip install --upgrade setuptools wheel
python setup.py sdist bdist_wheel
- name: Create package
run: |
pip install --upgrade setuptools wheel
python setup.py sdist bdist_wheel

- name: Verify package
run: |
pip install -q -r tests/requirements.txt
twine check dist/*
python setup.py clean
- name: Verify package
run: |
pip install -q -r tests/requirements.txt
twine check dist/*
python setup.py clean

pkg-install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: [3.8] #, 3.9
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.8"] #, 3.9
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Create package
run: |
pip install setuptools wheel
python setup.py sdist bdist_wheel

- name: Try installing
working-directory: dist
run: |
ls -lh
pip install $(python -c "import glob ; print(' '.join(glob.glob('*.whl')))")
pip show kaggle-sandbox
python -c "import challenge_xyz ; print(challenge_xyz.__version__)"
- name: Create package
run: |
pip install setuptools wheel
python setup.py sdist bdist_wheel

- name: Try installing
working-directory: dist
run: |
ls -lh
pip install $(python -c "import glob ; print(' '.join(glob.glob('*.whl')))")
pip show kaggle-sandbox
python -c "import challenge_xyz ; print(challenge_xyz.__version__)"

watcher:
runs-on: ubuntu-latest
needs: ["pkg-install", "pkg-check"]
if: always()
steps:
- run: echo "${{ needs.pkg-install.result }}"
- name: failing...
if: needs.pkg-install.result == 'failure'
run: exit 1
- name: cancelled or skipped...
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pkg-install.result)
timeout-minutes: 1
run: sleep 90
- run: echo "${{ needs.pkg-install.result }}"
- name: failing...
if: needs.pkg-install.result == 'failure'
run: exit 1
- name: cancelled or skipped...
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pkg-install.result)
timeout-minutes: 1
run: sleep 90
36 changes: 18 additions & 18 deletions .github/workflows/ci_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ jobs:
validate-schema:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Install pkg
run: pip install check-jsonschema
- name: Install pkg
run: pip install check-jsonschema

- name: Scan repo
id: folders
run: python -c "import os; print('gh_actions=' + str(int(os.path.isdir('.github/actions'))))" >> $GITHUB_OUTPUT
- name: Scan repo
id: folders
run: python -c "import os; print('gh_actions=' + str(int(os.path.isdir('.github/actions'))))" >> $GITHUB_OUTPUT

# https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
- name: GitHub Actions - workflow
run: |
files=$(find .github/workflows -name '*.yml' -or -name '*.yaml' -not -name '__*')
check-jsonschema -v $files --builtin-schema "github-workflows"
# https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
- name: GitHub Actions - workflow
run: |
files=$(find .github/workflows -name '*.yml' -or -name '*.yaml' -not -name '__*')
check-jsonschema -v $files --builtin-schema "github-workflows"

# https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-action.json
- name: GitHub Actions - action
if: steps.folders.outputs.gh_actions == '1'
run: |
files=$(find .github/actions -name '*.yml' -or -name '*.yaml')
heck-jsonschema -v $files --builtin-schema "github-actions"
# https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-action.json
- name: GitHub Actions - action
if: steps.folders.outputs.gh_actions == '1'
run: |
files=$(find .github/actions -name '*.yml' -or -name '*.yaml')
heck-jsonschema -v $files --builtin-schema "github-actions"
Loading
Loading