File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Test pipeline
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ jobs :
10+
11+ build :
12+ runs-on : ubuntu-latest
13+ outputs :
14+ image_tag : ${{ steps.set_image_tag.outputs.image_tag }}
15+
16+ steps :
17+ - uses : actions/checkout@v4
18+ - name : Set up environment variables
19+ id : set_image_tag
20+ run : echo "::set-output name=image_tag::$(date +%s)"
21+ - name : Build the Docker image
22+ run : docker build . --file Dockerfile --tag dhgen:${{ steps.set_image_tag.outputs.image_tag }}
23+ - name : Save Docker image as artifact
24+ run : docker save dhgen:${{ steps.set_image_tag.outputs.image_tag }} -o dhgen.tar
25+ - name : Upload Docker image artifact
26+ uses : actions/upload-artifact@v3
27+ with :
28+ name : dhgen-image
29+ path : dhgen.tar
30+
31+ test :
32+ runs-on : ubuntu-latest
33+ needs : build
34+
35+ steps :
36+ - name : Download Docker image artifact
37+ uses : actions/download-artifact@v3
38+ with :
39+ name : dhgen-image
40+ - name : Load Docker image
41+ run : docker load -i dhgen.tar
42+ - name : Run the tests
43+ run : docker run --rm dhgen:${{ needs.build.outputs.image_tag }} python -m unittest discover -s tests
You can’t perform that action at this time.
0 commit comments