Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 80 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
unit-tests:
unit-tests-core:
runs-on: ubuntu-latest
defaults:
run:
working-directory: core
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -25,13 +28,71 @@ jobs:
- name: Test with PyUnit and collect coverage
run: |
coverage run
coverage combine

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

unit-tests-python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: languages/python
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
pip install -e '.[dev]'
cd ../../core
pip install .

- name: Test with PyUnit and collect coverage
run: |
coverage run

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

unit-tests-ipython:
runs-on: ubuntu-latest
defaults:
run:
working-directory: languages/python
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
pip install -e '.[dev]'
cd ../python
pip install .
cd ../../core
pip install .

- name: Test with PyUnit and collect coverage
run: |
coverage run

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

e2e-tests:
name: Run End to End Tests
runs-on: ubuntu-latest
Expand All @@ -45,18 +106,24 @@ jobs:
with:
python-version: "3.12"

- name: Build container for tests
run: docker compose build
- name: Build Core
run: |
docker build . -f ./docker/core.dockerfile -t ghcr.io/csci128/128autograder/core:local
docker build . -f ./docker/core.dockerfile -t ghcr.io/csci128/128autograder/core:latest
- name: Build iPython
run: docker build . -f ./docker/ipython.dockerfile -t ghcr.io/csci128/128autograder/ipython:local
- name: Build Python
run: docker build . -f ./docker/python.dockerfile -t ghcr.io/csci128/128autograder/python:local

- name: Run tests
run: docker compose up

- name: Verify test outputs
run: bash tests/e2e/verify.sh

build-and-push-image-generic:
build-and-push-image-core:
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/main') }}
needs: [ unit-tests, e2e-tests ]
needs: [ unit-tests-core, e2e-tests ]
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -76,7 +143,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/generic
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/core
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
Expand All @@ -89,16 +156,19 @@ jobs:
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}/generic
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}/core
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

build-and-publish-pypi:
runs-on: ubuntu-latest
permissions:
id-token: write
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs: [ unit-tests, e2e-tests ]
defaults:
run:
working-directory: core
if: ${{ startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/version_') }}
needs: [ unit-tests-core, e2e-tests ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/macos-test.yaml

This file was deleted.

162 changes: 162 additions & 0 deletions .github/workflows/platform-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Platforms Integration Tests

on:
pull_request:

jobs:
macos-core-unittests:
runs-on: "macos-latest"
strategy:
matrix:
python-version: ["3.11", "3.12" ]
defaults:
run:
working-directory: core

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -e '.[dev]'

- name: Run tests
run: |
python3 -m unittest

windows-core-unittests:
runs-on: "windows-latest"
strategy:
matrix:
python-version: ["3.11", "3.12" ]
defaults:
run:
working-directory: core

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -e '.[dev]'

- name: Run tests
run: |
python3 -m unittest

macos-python-unittests:
runs-on: "macos-latest"
strategy:
matrix:
python-version: ["3.11", "3.12" ]
defaults:
run:
working-directory: languages/python

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -e '.[dev]'
cd ../../core
pip install .

- name: Run Tests
run: |
python3 -m unittest


windows-python-unittests:
runs-on: "windows-latest"
strategy:
matrix:
python-version: ["3.11", "3.12" ]
defaults:
run:
working-directory: languages/python

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -e '.[dev]'
cd ../../core
pip install .

- name: Run Tests
run: |
python3 -m unittest

windows-ipython-unittests:
runs-on: "windows-latest"
strategy:
matrix:
python-version: ["3.11", "3.12" ]
defaults:
run:
working-directory: languages/python

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -e '.[dev]'
cd ../python
pip install .
cd ../../core
pip install .

- name: Run Tests
run: |
python3 -m unittest

macos-ipython-unittests:
runs-on: "macos-latest"
strategy:
matrix:
python-version: ["3.11", "3.12" ]
defaults:
run:
working-directory: languages/python

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -e '.[dev]'
cd ../python
pip install .
cd ../../core
pip install .

- name: Run Tests
run: |
python3 -m unittest
29 changes: 0 additions & 29 deletions .github/workflows/windows-test.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ tests/e2e/*/output

!.keep
build
*.egg-info
*.egg-info
sandbox/
Loading
Loading