1010 required : false
1111
1212env :
13- IMAGE_REGISTRY : ghcr.io
14- API_IMAGE : ghcr.io/equinor/template-fastapi-react /api
15- WEB_IMAGE : ghcr.io/equinor/template-fastapi-react /web
13+ REGISTRY : ghcr.io
14+ API_IMAGE_PATH : ${{ github.repository }} /api
15+ WEB_IMAGE_PATH : ${{ github.repository }} /web
1616
1717jobs :
1818 api-unit-tests :
@@ -39,27 +39,40 @@ jobs:
3939 api-integration-tests :
4040 runs-on : ubuntu-latest
4141 steps :
42- - uses : actions/checkout@v4
42+ - name : " Setup: checkout repository"
43+ uses : actions/checkout@v4
4344
44- - name : " Login to GitHub Container Registry"
45+ - name : " Setup: Login to GitHub Container Registry"
4546 uses : docker/login-action@v3
4647 with :
47- registry : ${{ env.IMAGE_REGISTRY }}
48+ registry : ${{ env.REGISTRY }}
4849 username : ${{ github.actor }}
4950 password : ${{ secrets.GITHUB_TOKEN }}
5051
51- - name : Build API image
52- run : |
53- docker pull $API_IMAGE
54- docker build --target development --tag api-development ./api # TODO: --cache-from $API_IMAGE
52+ # - name: "Setup: Docker Buildx"
53+ # uses: docker/setup-buildx-action@v3
54+ #
55+ # - name: "Setup: Build API image"
56+ # uses: docker/build-push-action@v6
57+ # with:
58+ # context: ./api
59+ # target: development
60+ # load: true
61+ # tags: ${{ env.REGISTRY }}/${{ env.API_IMAGE_PATH }}:buildcache
62+ # cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.API_IMAGE_PATH }}:buildcache
63+
64+ # - name: Build API image
65+ # run: |
66+ # docker pull $API_IMAGE
67+ # docker build --target development --tag api-development ./api # TODO: --cache-from $API_IMAGE
68+
69+ - name : Pytest Integration tests
70+ run : docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api python -m pytest --integration
5571
5672 - name : BDD Integration tests
5773 if : ${{ false }} # disable for now
5874 run : docker compose -f docker-compose.yml -f docker-compose.ci.yml run api behave
5975
60- - name : Pytest Integration tests
61- run : docker compose -f docker-compose.yml -f docker-compose.ci.yml run --rm api pytest --integration
62-
6376 web-tests :
6477 runs-on : ubuntu-latest
6578 steps :
@@ -68,14 +81,14 @@ jobs:
6881 - name : " Login to GitHub Container Registry"
6982 uses : docker/login-action@v3
7083 with :
71- registry : ${{ env.IMAGE_REGISTRY }}
84+ registry : ${{ env.REGISTRY }}
7285 username : ${{ github.actor }}
7386 password : ${{ secrets.GITHUB_TOKEN }}
7487
7588 - name : Build Web Image
7689 run : |
77- docker pull $WEB_IMAGE
78- docker build --cache-from $WEB_IMAGE --target development --tag web-dev ./web
90+ docker pull ${REGISTRY}/${WEB_IMAGE_PATH}
91+ docker build --cache-from ${REGISTRY}/${WEB_IMAGE_PATH} --target development --tag web-dev ./web
7992
8093 - name : Run Web tests
8194 if : ${{ false }} # disable for now as they do not currently work
0 commit comments