Skip to content

Commit

Permalink
🔧 Update GitHub Action matrix names to make it clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Mar 30, 2024
1 parent ab96545 commit d6fd041
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
package_dir:
- ./
- typer_package
- typer_cli_package
package:
- typer-slim
- typer
- typer-cli
env:
dir: ${{ matrix.package == 'typer-slim' && './' || matrix.package == 'typer' && 'typer_package' || matrix.package == 'typer-cli' && 'typer_cli_package' }}
permissions:
id-token: write
steps:
Expand All @@ -36,9 +38,9 @@ jobs:
- name: Install build dependencies
run: pip install build
- name: Build distribution
working-directory: ${{ matrix.package_dir }}
working-directory: ${{ env.dir }}
run: python -m build
- name: Publish
uses: pypa/[email protected]
with:
packages-dir: ${{ matrix.package_dir }}/dist/
packages-dir: ${{ env.dir }}/dist/
24 changes: 11 additions & 13 deletions .github/workflows/test-redistribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
package_dir:
- ./
- typer_package
- typer_cli_package
package:
- typer-slim
- typer
- typer-cli
env:
dir: ${{ matrix.package == 'typer-slim' && './' || matrix.package == 'typer' && 'typer_package' || matrix.package == 'typer-cli' && 'typer_cli_package' }}
steps:
- name: Dump GitHub context
env:
Expand All @@ -34,29 +36,25 @@ jobs:
- name: Install build dependencies
run: pip install build
- name: Build source distribution
working-directory: ${{ matrix.package_dir }}
working-directory: ${{ env.dir }}
run: python -m build --sdist
- name: Decompress source distribution
working-directory: ${{ matrix.package_dir }}
working-directory: ${{ env.dir }}
run: |
cd dist
tar xvf typer*.tar.gz
- name: Install test dependencies
if: ${{ matrix.package_dir == './' }}
if: ${{ matrix.package == 'typer-slim' }}
run: |
cd dist/typer*/
pip install -r requirements-tests.txt
- name: Run source distribution tests
if: ${{ matrix.package_dir == './' }}
if: ${{ matrix.package == 'typer-slim' }}
run: |
cd dist/typer*/
bash scripts/test.sh
- name: Build wheel distribution
working-directory: ${{ matrix.package_dir }}
working-directory: ${{ env.dir }}
run: |
cd dist
pip wheel --no-deps typer*.tar.gz
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

0 comments on commit d6fd041

Please sign in to comment.