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

freeze schema version & dependabot #148

Merged
merged 12 commits into from
Sep 18, 2023
Merged
16 changes: 14 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
# Enable version updates for python
- package-ecosystem: "pip"
directory: "/requirements"
schedule:
interval: "weekly"
labels: ["ci/cd"]
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 5
reviewers:
- "Lightning-AI/core-lightning"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "ci/cd"
labels: ["ci/cd"]
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 5
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,3 @@ jobs:

- name: Run pre-commit
uses: pre-commit/[email protected]
# this action also provides an additional behaviour when used in private repositories
# when configured with a github token, the action will push back fixes to the pull request branch
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
24 changes: 22 additions & 2 deletions .github/workflows/check-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Check schema flow
on:
workflow_call:
inputs:
actions-ref:
description: 'Version of actions, normally the same as workflow'
required: false
type: string
default: ""
azure-dir:
description: 'Directory containing Azure Pipelines config files. Provide an empty string to skip checking on Azure Pipelines files.'
default: '.azure/'
Expand All @@ -23,9 +28,24 @@ jobs:
with:
submodules: recursive

- name: Install dependencies
# if actions version is given install defined versions
- name: "[optional] Pull re-usable 🤖 actions"
if: inputs.actions-ref != ''
uses: actions/checkout@v4
with:
ref: ${{ inputs.actions-ref }}
path: .cicd
repository: Lightning-AI/utilities
- name: "[optional] Install recommended dependencies"
if: inputs.actions-ref != ''
run: |
pip install -r ./.cicd/requirements/gha-schema.txt
pip list | grep "check-jsonschema"
# otherwise fall back to using the latest
- name: "[default] Install recommended dependencies"
if: inputs.actions-ref == ''
run: |
pip install check-jsonschema -q
pip install -q check-jsonschema
pip list | grep "check-jsonschema"

- name: Scan repo
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/ci-use-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,24 @@ jobs:
actions-ref: ${{ github.sha }} # use local version
extra-typing: 'typing'

check-schema:
check-schema-latest:
uses: ./.github/workflows/check-schema.yml
with:
azure-dir: ""

check-schema-fixed:
uses: ./.github/workflows/check-schema.yml
with:
actions-ref: ${{ github.sha }} # use local version
azure-dir: ""

check-schema:
runs-on: ubuntu-latest
# just aggregation of the previous two jobs
needs: ["check-schema-latest", "check-schema-fixed"]
steps:
- run: echo "done"

check-package:
uses: ./.github/workflows/check-package.yml
with:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed issue with `is_overridden` falsely returning True when the parent method is wrapped ([#149](https://github.com/Lightning-AI/utilities/pull/149))


- CI: optional freeze version of schema check ([148](https://github.com/Lightning-AI/utilities/pull/148))


## [0.9.0] - 2023-06-29

### Added
Expand Down
1 change: 1 addition & 0 deletions requirements/gha-schema.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
check-jsonschema ==0.23.3
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _load_py_module(fname: str, pkg: str = "lightning_utilities"):
# make extras as automated loading
requirements_extra = {}
for fpath in glob.glob(os.path.join(_PATH_REQUIRE, "*.txt")):
if os.path.basename(fpath) in ("base.txt", "dev-docs.txt", "dev-tests.txt"):
if os.path.basename(fpath) in ("base.txt", "dev-docs.txt", "dev-tests.txt", "gha-schema.txt"):
continue
name, _ = os.path.splitext(os.path.basename(fpath))
with open(fpath) as fp:
Expand Down