Skip to content

Commit

Permalink
fix calling actions in external re-usable workflows (#51)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Borda and pre-commit-ci[bot] authored Dec 24, 2022
1 parent 10fdf4a commit 79ec5f6
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 14 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Check formating flow
on:
workflow_call:
inputs:
actions-ref:
description: 'Version of actions, normally the same as workflow'
required: true
type: string
python-version:
description: 'Python version to use'
default: '3.9'
Expand All @@ -27,10 +31,16 @@ jobs:
pip install mypy types-setuptools # don't use --upgrade to respect the version installed via setup.py
pip list
# TODO: re-enable after the external usage is resolved, see #51
# - uses: ./.github/actions/pip-list
# with:
# unfold: true
- name: Pull re-usable 🤖 actions️
uses: actions/checkout@v3
with:
ref: ${{ inputs.actions-ref }}
path: .cicd
repository: Lightning-AI/utilities
- name: Print 🖨️ dependencies
uses: ./.cicd/.github/actions/pip-list
with:
unfold: true

- name: Check typing
# mypy uses the config file found in the following order:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
inputs:
azure-dir:
description: 'Directory containing Azure Pipelines config files. Provide an empty string to skip checking on Azure Pipelines files.'
default: './.azure/'
default: '.azure/'
required: false
type: string

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
pip --version
pip list
# TODO: re-enable after the external usage is resolved, see #51
# - uses: ./.github/actions/pip-list
- name: Print 🖨️ dependencies
uses: ./.github/actions/pip-list

- name: Unittesting and coverage
uses: ./.github/actions/unittesting
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-use-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ concurrency:
jobs:
check-code:
uses: ./.github/workflows/check-code.yml
with:
actions-ref: ${{ github.sha }} # use local version

check-schema:
uses: ./.github/workflows/check-schema.yml
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
pip list
shell: bash

# TODO: re-enable after the external usage is resolved, see #51
# - uses: ./.github/actions/pip-list
- name: Print 🖨️ dependencies
uses: ./.github/actions/pip-list

- name: Make Documentation
run: |
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Apply local actions in re-usable workflows ([#51](https://github.com/Lightning-AI/utilities/pull/51))


### Fixed

Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ name: Check schema
on: [push]

jobs:

check-schema:
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@main
uses: Lightning-AI/utilities/.github/workflows/[email protected]
with:
azure-dir: "" # skip Azure check

check-code:
uses: Lightning-AI/utilities//.github/workflows/check-code.yml@main
with:
azure-dir: ""
actions-ref: main # normally you shall use the same version as the workflow
```
See usage of other workflows in [.github/workflows/ci_use-checks.yml](https://github.com/Lightning-AI/utilities/tree/main/.github/workflows/ci_use-checks.yml).
See usage of other workflows in [.github/workflows/ci-use-checks.yml](https://github.com/Lightning-AI/utilities/tree/main/.github/workflows/ci-use-checks.yml).
## 2. Reusable composite actions
Expand All @@ -52,8 +58,7 @@ jobs:
- uses: Lightning-AI/utilities/.github/actions/cache
with:
python-version: 3.9
requires: oldest
# requires: latest
requires: oldest # or latest
```
## 3. CLI `lightning_utilities.cli`
Expand Down

0 comments on commit 79ec5f6

Please sign in to comment.