Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
espenhgn committed Sep 22, 2024
1 parent 541b0fc commit e88db91
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/container_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ jobs:

- name: Run unit tests
run: |
docker run --rm ${{ env.TEST_TAG }} python --version
echo ${{ github.workspace }}
ls -la ${{ github.workspace }}/..
docker run --rm -v ${{ github.workspace }}:/home ${{ env.TEST_TAG }} py.test -v tests
- name: Build
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/container_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand Down Expand Up @@ -51,7 +53,7 @@ jobs:
./dockerfiles/container_template/Dockerfile
- name: Test
run: |
docker run --rm ${{ env.TEST_TAG }}
docker run --rm -v ${{ github.workspace }}:/home ${{ env.TEST_TAG }} py.test -v tests
- name: Build and push
uses: docker/build-push-action@v6
Expand Down
4 changes: 2 additions & 2 deletions tests/test_container_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
port = sock.getsockname()[1]

# Check that (1) singularity exist, and (2) if not, check for docker.
# If neither are found, tests will not run.
# If neither are found, tests will fall back to plain python.
try:
pth = os.path.join('containers', 'container_template.sif')
out = subprocess.run('singularity')
cwd = os.getcwd()
PREFIX = f'singularity run {pth} python'
PREFIX_MOUNT = PREFIX_MOUNT = f'singularity run --home={cwd}:/home/ {pth} python'
PREFIX_MOUNT = f'singularity run --home={cwd}:/home/ {pth} python'
except FileNotFoundError:
try:
out = subprocess.run('docker')
Expand Down

0 comments on commit e88db91

Please sign in to comment.