11name : ci
22
33on :
4- - push
5- - pull_request
4+ push :
5+ branches : [eio, eio-prod]
6+
67
78jobs :
89 test :
910 runs-on : ubuntu-24.04
1011
1112 strategy :
1213 matrix :
13- base_image : ["ubuntu:noble", "debian:bookworm" ]
14+ base_image : ["ubuntu:noble"]
1415
1516 steps :
1617 - uses : actions/checkout@v2
@@ -19,35 +20,27 @@ jobs:
1920 run : |
2021 mount | grep cgroup
2122
22- - name : Build docker image
23+ - name : Set up docker buildx
24+ uses : docker/setup-buildx-action@v3
25+
26+ - name : Login to docker
27+ run : |
28+ docker login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
29+
30+ - name : Build and push docker image
2331 run : |
24- docker compose -p cms -f docker/docker-compose.test.yml build \
25- --build-arg BASE_IMAGE=${{ matrix.base_image }} testcms
32+ if [ "$GITHUB_REF_NAME" = "eio-prod" ]; then
33+ TAGNAME=prod
34+ else
35+ TAGNAME=test
36+ fi
37+ docker buildx build --load --push -t ghcr.io/e-i-o/cms:$TAGNAME . \
38+ --cache-from type=registry,ref=ghcr.io/e-i-o/cms:build-cache \
39+ --cache-to type=registry,ref=ghcr.io/e-i-o/cms:build-cache \
40+ --build-arg BASE_IMAGE=${{ matrix.base_image }}
41+ docker tag ghcr.io/e-i-o/cms:$TAGNAME cms-testcms
2642
2743 - name : Run tests
2844 run : |
2945 docker compose -p cms -f docker/docker-compose.test.yml run --rm testcms
3046
31- - name : Upload test results to Codecov
32- if : ${{ !cancelled() }}
33- uses : codecov/test-results-action@v1
34- with :
35- files : ./codecov/junit.xml
36- flags : unittests
37- token : ${{ secrets.CODECOV_TOKEN }}
38-
39- - name : Upload unit test coverage results to Codecov
40- uses : codecov/codecov-action@v4
41- if : ${{ !cancelled() }}
42- with :
43- files : ./codecov/unittests.xml
44- flags : unittests
45- token : ${{ secrets.CODECOV_TOKEN }}
46-
47- - name : Upload functional test coverage results to Codecov
48- uses : codecov/codecov-action@v4
49- if : ${{ !cancelled() }}
50- with :
51- files : ./codecov/functionaltests.xml
52- flags : functionaltests
53- token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments