Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodearnest committed Sep 30, 2024
1 parent a4e9cb4 commit f033078
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ jobs:
run: docker login https://ghcr.io -u ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
- name: Push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:latest
IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME"
docker tag "$IMAGE_NAME" "$IMAGE_ID:latest"
docker push "$IMAGE_ID:latest"
create-release-from-tag:
name: Create release from tag
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:

test-job:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, windows-2019, macos-12]
# Python 3.8 is what we currently support for running cohortextractor
Expand All @@ -33,6 +34,8 @@ jobs:
python: ["3.8", "3.9", "3.10"]
runs-on: ${{ matrix.os }}
name: Run test suite
env:
PYTHON_VERSION: "python${{ matrix.python }}"
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -65,11 +68,20 @@ jobs:
- uses: extractions/setup-just@69d82fb0233557aec017ef13706851d0694e0f1d

- name: Run actual tests on ${{ matrix.os }}
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: just test -vvv
if: ${{ matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' }}
run: |
echo "$PYTHON_VERSION"
just test -vvv
- name: Run actual tests on ${{ matrix.os }}
if: ${{ matrix.os == 'windows-2019' || matrix.os == 'macos-12' }}
- name: Run actual tests on windows
if: ${{ matrix.os == 'windows-2019' }}
run: |
# windows powershell: set to executable w/o version, as it doesn't have one on windows
$Env:PYTHON_VERSION = "python"
just test-no-docker -vvv
- name: Run actual tests on macos
if: ${{ matrix.os == 'macos-12' }}
run: just test-no-docker -vvv

test-package-build:
Expand Down
2 changes: 2 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ virtualenv:
set -euo pipefail
# allow users to specify python version in .env
echo $PYTHON_VERSION
PYTHON_VERSION=${PYTHON_VERSION:-$DEFAULT_PYTHON}
echo $PYTHON_VERSION

# create venv and upgrade pip
test -d $VIRTUAL_ENV || { $PYTHON_VERSION -m venv $VIRTUAL_ENV && $PIP install --upgrade pip; }
Expand Down

0 comments on commit f033078

Please sign in to comment.