diff --git a/.circleci/config.yml b/.circleci/config.yml index 95ae89f..6faa35e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,15 +10,25 @@ workflows: context: - "github" - "Docker Hub" - - example-build: + - test: requires: - build + matrix: + parameters: + platform: + - linux/amd64 + - linux/arm64 + context: + - "github" + - "Docker Hub" + - example-build: + requires: + - test context: - "github" - "Docker Hub" - example-deploy: requires: - - build - example-build context: - "github" @@ -50,6 +60,7 @@ jobs: build: machine: image: ubuntu-2204:2023.02.1 + resource_class: large steps: - setup - checkout @@ -74,9 +85,31 @@ jobs: --no-cache \ --progress=plain \ --push . + test: + parameters: + platform: + type: enum + enum: ["linux/amd64", "linux/arm64"] + machine: + image: ubuntu-2204:2023.02.1 + resource_class: medium + steps: + - run: + name: Test docker image (<< parameters.platform >>) + no_output_timeout: 1h + command: | + echo "${DOCKER_PASS}" | docker login -u "${DOCKER_USER}" --password-stdin + docker pull ${DOCKER_USER}/asciidoctor:${CIRCLE_TAG:-latest} + docker run --rm \ + -v $(pwd)/src/doc:/documents/ \ + -v $(pwd)/.examples/dist:/dist \ + --platform << parameters.platform >> \ + ${DOCKER_USER}/asciidoctor:${CIRCLE_TAG:-latest} \ + inliner --help example-build: machine: image: ubuntu-2204:2023.02.1 + resource_class: large steps: - checkout - run: diff --git a/Dockerfile b/Dockerfile index 014d0a2..e55ec1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -213,17 +213,22 @@ RUN apk --no-cache add \ # 'Ruby' packages # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Install barby - @see: https://github.com/toretore/barby +# (Re)Install nogokiri - @see: https://nokogiri.org/tutorials/installing_nokogiri.html#other-installation-scenarios # Install asciidoctor-multipage - @see: https://github.com/owenh000/asciidoctor-multipage # Install asciidoctor-lists - @see: https://github.com/Alwinator/asciidoctor-lists RUN apk add --no-cache --virtual .rubymakedepends \ build-base \ libxml2-dev \ + libxslt-dev \ ruby-dev \ && gem install --no-document \ barby rqrcode chunky_png \ asciidoctor-multipage \ asciidoctor-lists \ - && apk del -r --no-cache .rubymakedepends + && apk del -r --no-cache .rubymakedepends \ + # @see: https://github.com/asciidoctor/docker-asciidoctor/issues/430 + # @see: https://github.com/asciidoctor/docker-asciidoctor/blob/d16e85e04c46ed02414565aa26b67a809f4c64c1/Dockerfile#L139 + && if [[ ${TARGETARCH} == arm64 ]]; then gem uninstall nokogiri -v '> 1.14'; fi # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 'Python' packages