Skip to content

Commit

Permalink
Add test package step
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Sep 5, 2024
1 parent 54c2dd3 commit d10ab17
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: CI

concurrency:
# Concurrency is defined in a way that concurrent builds against branches do
# not cancel previous builds.
# However, for every new build against the same pull request source branch,
# all older builds against that same branch get canceled.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.repository }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
#concurrency:
# # Concurrency is defined in a way that concurrent builds against branches do
# # not cancel previous builds.
# # However, for every new build against the same pull request source branch,
# # all older builds against that same branch get canceled.
# group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.repository }}-${{ github.head_ref || github.run_id }}
# cancel-in-progress: true

on:
workflow_call:
Expand Down Expand Up @@ -64,20 +64,29 @@ jobs:
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}

test:
name: Test
needs:
- get-changed-files
uses: ./.github/workflows/test-action.yml
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}

build-python-package:
name: Python Package
uses: ./.github/workflows/package-action.yml
needs:
- pre-commit
- test
with:
kind: "${{ inputs.kind }}"
cmd: "${{ inputs.package_command }}"

test:
name: Test
test-python-package:
name: Test Python Package
needs:
- get-changed-files
uses: ./.github/workflows/test-action.yml
uses: ./.github/workflows/test-package-action.yml
with:
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}

Expand All @@ -88,6 +97,7 @@ jobs:
needs:
- pre-commit
- test
- test-python-package
- build-python-package
secrets:
PYPI_API_TOKEN: "${{ secrets.PYPI_API_TOKEN }}"
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/test-package-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Package Tests

on:
workflow_call:
inputs:
changed-files:
required: true
type: string
description: JSON string containing information about changed files

jobs:
test:
strategy:
fail-fast: false
matrix:
runs-on:
- ubuntu-latest
- macos-12
- macos-13-xlarge
- windows-latest

name: Package Test ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install python dependencies
run: |
pip3 install pytest
- name: Run tests
run: |
pytest -v

0 comments on commit d10ab17

Please sign in to comment.