10
10
env :
11
11
IMAGE_NAME : pynucleus
12
12
IMAGE_TAGS : latest ${{ github.sha }}
13
+ TEST_IMAGE_TAG : ${{ github.sha }}
13
14
IMAGE_REGISTRY : ghcr.io/${{ github.repository_owner }}
14
15
REGISTRY_USER : ${{ github.actor }}
15
16
REGISTRY_PASSWORD : ${{ github.token }}
21
22
timeout-minutes : 300
22
23
23
24
steps :
25
+ - name : Change image tags for PRs
26
+ if : github.event_name == 'pull_request'
27
+ run : |
28
+ echo "IMAGE_TAGS=pr-${{ github.event.number }}" >> $GITHUB_ENV
29
+ echo "TEST_IMAGE_TAG=pr-${{ github.event.number }}" >> $GITHUB_ENV
30
+
24
31
- name : Check out
25
32
if : always()
26
33
uses : actions/checkout@v4
@@ -44,14 +51,27 @@ jobs:
44
51
build-args : |
45
52
PYNUCLEUS_BUILD_PARALLELISM=4
46
53
54
+ - name : Push To GHCR
55
+ if : github.event_name == 'pull_request'
56
+ uses : redhat-actions/push-to-registry@v2
57
+ id : push-pr
58
+ with :
59
+ image : ${{ steps.build_image.outputs.image }}
60
+ tags : ${{ env.IMAGE_TAGS }}
61
+ registry : ${{ env.IMAGE_REGISTRY }}
62
+ username : ${{ env.REGISTRY_USER }}
63
+ password : ${{ env.REGISTRY_PASSWORD }}
64
+ extra-args : |
65
+ --disable-content-trust
66
+
47
67
- name : Run tests
48
68
run : |
49
69
podman run \
50
70
-e MPIEXEC_FLAGS="--allow-run-as-root --oversubscribe" \
51
71
--workdir /pynucleus \
52
72
--rm \
53
73
--entrypoint='["python3", "-m", "pytest", "--junit-xml", "test-results.xml"]' \
54
- ${{ steps.build_image.outputs.image }}:${{ github.sha }}
74
+ ${{ steps.build_image.outputs.image }}:${{ env.TEST_IMAGE_TAG }}
55
75
56
76
- name : Push To GHCR
57
77
if : github.event_name == 'push'
73
93
74
94
container-test :
75
95
needs : container
76
- if : github.event_name == 'push'
77
96
78
97
strategy :
79
98
matrix :
0 commit comments