-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support multi-platform build using buildx
- Loading branch information
Showing
3 changed files
with
134 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Acceptance tests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- synchronize | ||
|
||
env: | ||
DOCKER_PLATFORMS: linux/amd64,linux/arm64 | ||
|
||
jobs: | ||
build-base-python-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
# https://github.com/docker/setup-qemu-action/releases/tag/v1.2.0 | ||
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 | ||
- name: Build Image | ||
run: | | ||
docker buildx build --platform ${{env.DOCKER_PLATFORMS}} -t py docker/py/ | ||
docker save py > /tmp/py.tar | ||
- name: Upload Image Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: py | ||
path: /tmp/py.tar | ||
|
||
acceptance-tests: | ||
needs: build-base-python-image | ||
strategy: | ||
matrix: | ||
include: | ||
- image_name: py | ||
test_user: jovyan | ||
- image_name: cuda-tf | ||
build_arg: BASE_IMAGE=py | ||
test_user: jovyan | ||
- image_name: generic | ||
build_arg: RENKU_BASE=py | ||
test_user: jovyan | ||
- image_name: julia | ||
build_arg: BASE_IMAGE=py | ||
test_user: jovyan | ||
- image_name: r | ||
build_arg: RENKU_BASE=py | ||
test_user: rstudio | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download Base Image | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: py | ||
path: /tmp | ||
- name: Set up QEMU | ||
# https://github.com/docker/setup-qemu-action/releases/tag/v1.2.0 | ||
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25 | ||
- name: Load Base Image in Docker | ||
run: | | ||
docker load --input /tmp/py.tar | ||
- name: Build images | ||
if: ${{ matrix.image_name != 'py' }} | ||
run: | | ||
docker buildx build --platform ${{env.DOCKER_PLATFORMS}} -t ${{ matrix.image_name }} --build-arg ${{ matrix.build_arg }} docker/${{ matrix.image_name }}/ | ||
- name: Py Image Acceptance Tests | ||
uses: cypress-io/github-action@v2 | ||
env: | ||
TEST_IMAGE_NAME: ${{ matrix.image_name }} | ||
TEST_USER_NAME: ${{ matrix.test_user }} | ||
with: | ||
working-directory: tests | ||
command: npx mocha test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters