diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e5d41132..6175f254c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,7 +43,7 @@ stages: .multi_platform: &multi_platform parallel: matrix: - - PLATFORM: [ amd64, arm64 ] + - PLATFORM: [ arm, arm64, amd64 ] tags: # some will override this part - ${PLATFORM} - docker @@ -197,25 +197,43 @@ build:macOS: - pip3 install -U requests - python3 ./ci/gh_actions.py ${CI_COMMIT_REF_NAME} ${CI_COMMIT_SHA} -docker: + +.docker: &docker <<: *nodep - stage: build - image: docker:latest <<: *multi_platform + image: docker:latest + variables: + DOCKER_IMAGE_NAME: knot-resolver-test:${PLATFORM} only: refs: - branches@knot/knot-resolver tags: - ${PLATFORM} - dind - variables: - DOCKER_IMAGE_NAME: knot-resolver-test:${CI_COMMIT_SHA} + +docker:build: + <<: *docker + stage: build script: - docker build --no-cache -t ${DOCKER_IMAGE_NAME} . - # TODO: perhaps try if the running image answers queries + - docker save ${DOCKER_IMAGE_NAME} -o ${DOCKER_IMAGE_NAME}.tar + artifacts: + paths: + - ${DOCKER_IMAGE_NAME}.tar + after_script: # remove dangling images to avoid running out of disk space - docker rmi ${DOCKER_IMAGE_NAME} - docker rmi $(docker images -f "dangling=true" -q) + +docker:test: + <<: *docker + stage: test + needs: + - docker:build + script: + - docker load -i ${DOCKER_IMAGE_NAME}.tar + - docker run -n ${DOCKER_IMAGE_NAME} -d ${DOCKER_IMAGE_NAME} + # }}} # sanity {{{