-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More consolidation through custom actions
- Loading branch information
Showing
4 changed files
with
63 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# A re-usable github action which generates the breadbox client | ||
name: "prepare-breadbox-client" | ||
description: "Auto-generate the breadbox client" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Prepare breadbox client | ||
uses: ./.github/actions/prepare-breadbox # checks out and installs poetry | ||
|
||
- name: "Export the OpenAPI spec" | ||
working-directory: "./breadbox" | ||
run: | | ||
poetry install | ||
poetry run ./bb export-api-spec ../breadbox-client/latest-breadbox-api.json | ||
- name: "Create client from spec" | ||
working-directory: "./breadbox-client-generator" | ||
run: | | ||
poetry install | ||
poetry run ./generate.sh | ||
- name: "peek at poetry cachedir" | ||
run: "ls -l ${{ steps.poetry-cachedir.outputs.POETRY_CACHEDIR }}/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# A re-usable github action which does the initial checkout and sets up poetry with caching for breadbox | ||
name: "prepare-breadbox" | ||
description: "Checks out and prepares poetry (with caching)" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Compute poetry cache dir" | ||
id: "poetry-cachedir" | ||
run: 'echo POETRY_CACHEDIR="$HOME/.cache/pypoetry" >> "$GITHUB_OUTPUT"' | ||
|
||
- name: "Check out" | ||
uses: actions/checkout@v3 | ||
with: | ||
token: "${{ secrets.GITHUB_TOKEN }}" | ||
fetch-depth: 0 | ||
|
||
- name: "Install and configure Poetry" | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.8.2 | ||
virtualenvs-create: true | ||
|
||
- name: "Set up poetry cache" | ||
uses: actions/cache@v2 | ||
id: cached-poetry-dependencies | ||
with: | ||
path: "${{ steps.poetry-cachedir.outputs.POETRY_CACHEDIR }}" | ||
key: "breadbox-venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('breadbox*/**/poetry.lock') }}" | ||
|
||
- name: "peek at poetry cachedir (for debugging)" | ||
run: "ls -l ${{ steps.poetry-cachedir.outputs.POETRY_CACHEDIR }}/* || true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters