diff --git a/.github/workflows/check-code.yml b/.github/workflows/check-code.yml index 87e9d217..8c8735d4 100644 --- a/.github/workflows/check-code.yml +++ b/.github/workflows/check-code.yml @@ -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' @@ -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: diff --git a/.github/workflows/check-schema.yml b/.github/workflows/check-schema.yml index 98c9ca53..3bebf89d 100644 --- a/.github/workflows/check-schema.yml +++ b/.github/workflows/check-schema.yml @@ -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 diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 80fca35b..b0726d13 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -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 diff --git a/.github/workflows/ci-use-checks.yml b/.github/workflows/ci-use-checks.yml index 7aeb2adf..1d9e91d4 100644 --- a/.github/workflows/ci-use-checks.yml +++ b/.github/workflows/ci-use-checks.yml @@ -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 diff --git a/.github/workflows/schedule-clear-cache.yml b/.github/workflows/cron-clear-cache.yml similarity index 100% rename from .github/workflows/schedule-clear-cache.yml rename to .github/workflows/cron-clear-cache.yml diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/deploy-docs.yml similarity index 95% rename from .github/workflows/docs-deploy.yml rename to .github/workflows/deploy-docs.yml index 38ebe485..424717bf 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/deploy-docs.yml @@ -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: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 52112ff3..70d369b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 4ca38b67..59db19ed 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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`