@@ -39,19 +39,58 @@ jobs:
3939 with :
4040 images : ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
4141
42+ - name : Set up Docker Buildx
43+ id : buildx
44+ uses : docker/setup-buildx-action@v3.11.1
45+
46+ - name : Build and push by digest
47+ if : github.event_name == 'pull_request'
48+ uses : docker/build-push-action@v6.18.0
49+ with :
50+ file : ./docker/Dockerfile
51+ platforms : ${{ matrix.platform }}
52+ labels : ${{ steps.meta.outputs.labels }}
53+ tags : ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
54+ outputs : type=docker,push-by-digest=true,name-canonical=true,push=true
55+
56+ - name : Run tests
57+ if : github.event_name == 'pull_request'
58+ shell : bash
59+ run : |
60+ docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}:latest bash -c " \
61+ mkdir us5; \
62+ cd us5; \
63+ ln -s ../data/md5.rst md.rst; \
64+ bash ../scripts/setup_umb_samp.sh; \
65+ bash run_umb_samp.sh; \
66+ wait; \
67+ bash ../scripts/run_wham.sh; \
68+ wait; \
69+ cpptraj < ../data/make_us_trj.in &> make_us_trj.log; \
70+ wait; \
71+ cd ..; \
72+ mkdir adiab5; \
73+ cd adiab5; \
74+ ln -s ../us5/rc-0.30/md1ps.rst md1ps_rc-0.3.rst; \
75+ bash ../scripts/run_adiab_all.sh; \
76+ wait; \
77+ cpptraj < ../data/make_adiab_trj.in &> make_adiab_trj.log; \
78+ wait; \
79+ cd ..; \
80+ pip install pytest nbmake; \
81+ find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "
82+
4283 - name : Authenticate with GHCR
84+ if : github.event_name != 'pull_request'
4385 id : auth
4486 uses : docker/login-action@v3.6.0
4587 with :
4688 registry : ghcr.io
4789 username : ${{ github.repository_owner }}
4890 password : ${{ secrets.BUILD_TOKEN }}
4991
50- - name : Set up Docker Buildx
51- id : buildx
52- uses : docker/setup-buildx-action@v3.11.1
53-
5492 - name : Build and push by digest
93+ if : github.event_name != 'pull_request'
5594 id : build
5695 uses : docker/build-push-action@v6.18.0
5796 with :
61100 tags : ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}
62101 outputs : type=image,push-by-digest=true,name-canonical=true,push=true
63102
64- - name : Test notebooks
103+ - name : Run tests
104+ if : github.event_name != 'pull_request'
65105 shell : bash
66106 run : |
67107 docker run -t ghcr.io/${{ vars.ORG_REPO }}/${{ github.event.repository.name }}@${{ steps.build.outputs.digest }} bash -c " \
@@ -88,12 +128,14 @@ jobs:
88128 find . -name '*.ipynb' | pytest --nbmake --nbmake-timeout=3600; "
89129
90130 - name : Export digest
131+ if : github.event_name != 'pull_request'
91132 run : |
92133 mkdir -p ${{ runner.temp }}/digests
93134 digest="${{ steps.build.outputs.digest }}"
94135 touch "${{ runner.temp }}/digests/${digest#sha256:}"
95136
96137 - name : Upload digest
138+ if : github.event_name != 'pull_request'
97139 uses : actions/upload-artifact@v5.0.0
98140 with :
99141 name : digests-${{ env.PLATFORM_PAIR }}
0 commit comments