Skip to content

Commit

Permalink
ci: expand test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
lsorber authored Apr 3, 2024
1 parent fa74f82 commit 0cf9f56
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.10"]
project-type: ["app", "package"]

name: Python ${{ matrix.python-version }}

Expand All @@ -31,15 +32,15 @@ jobs:
- name: Scaffold Python project
run: |
pip install --no-input cruft
cruft create --no-input --extra-context '{"project_type": "app", "project_name": "My App", "python_version": "3.8", "__docker_image":"radixai/python-gpu:$PYTHON_VERSION-cuda11.8", "with_fastapi_api": "1", "with_typer_cli": "1"}' ./template/
cruft create --no-input --extra-context '{"project_type": "${{ matrix.project-type }}", "project_name": "My Project", "python_version": "3.8", "__docker_image":"radixai/python-gpu:$PYTHON_VERSION-cuda11.8", "with_fastapi_api": "1", "with_typer_cli": "1"}' ./template/
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 21

- name: Install @devcontainers/cli
run: npm install --location=global @devcontainers/cli@0.55.0
run: npm install --location=global @devcontainers/cli@0.58.0

- name: Start Dev Container with Python ${{ matrix.python-version }}
run: |
Expand All @@ -48,19 +49,20 @@ jobs:
git checkout -b test
git add .
PYTHON_VERSION=${{ matrix.python-version }} devcontainer up --workspace-folder .
working-directory: ./my-app/
working-directory: ./my-project/

- name: Lint project
run: devcontainer exec --workspace-folder my-app poe lint
run: devcontainer exec --workspace-folder my-project poe lint

- name: Test project
run: devcontainer exec --workspace-folder my-app poe test
run: devcontainer exec --workspace-folder my-project poe test

- name: Build app Docker image
if: ${{ matrix.project-type }} == "app"
uses: docker/build-push-action@v5
with:
build-args: |
SOURCE_BRANCH=${{ env.GITHUB_REF }}
SOURCE_COMMIT=${{ env.GITHUB_SHA }}
context: ./my-app/
context: ./my-project/
target: app
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
node-version: 21

- name: Install @devcontainers/cli
run: npm install --location=global @devcontainers/cli@0.55.0
run: npm install --location=global @devcontainers/cli@0.58.0

- name: Start Dev Container
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ variables:
- .npm_cache
before_script:
- mkdir -p .apk_cache && apk add --cache-dir .apk_cache npm
- npm install --cache .npm_cache --global --prefer-offline @devcontainers/cli@0.55.0
- npm install --cache .npm_cache --global --prefer-offline @devcontainers/cli@0.58.0

# Build the Dev Container.
Build:
Expand Down

0 comments on commit 0cf9f56

Please sign in to comment.