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

fix calling actions in external re-usable workflows #51

Merged
merged 4 commits into from
Dec 24, 2022
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
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
Borda marked this conversation as resolved.
Show resolved Hide resolved
- 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
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/check-schema.yml@v0.5.0
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