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
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test pipeline

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.set_image_tag.outputs.image_tag }}

steps:
- uses: actions/checkout@v4
- name: Set up environment variables
id: set_image_tag
run: echo "::set-output name=image_tag::$(date +%s)"
- name: Build the Docker image
run: docker build . --file Dockerfile --tag dhgen:${{ steps.set_image_tag.outputs.image_tag }}
- name: Save Docker image as artifact
run: docker save dhgen:${{ steps.set_image_tag.outputs.image_tag }} -o dhgen.tar
- name: Upload Docker image artifact
uses: actions/upload-artifact@v3
with:
name: dhgen-image
path: dhgen.tar

test:
runs-on: ubuntu-latest
needs: build

steps:
- name: Download Docker image artifact
uses: actions/download-artifact@v3
with:
name: dhgen-image
- name: Load Docker image
run: docker load -i dhgen.tar
- name: Run the tests
run: docker run --rm dhgen:${{ needs.build.outputs.image_tag }} python -m unittest discover -s tests
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ test = [
"pandas==1.5.3",
"networkx==3.0",
"requests==2.28.2",
"fiona==1.9.1",
]

File renamed without changes.