Try to fix testing #21
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
name: Build and Push Georust Docker Images | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- staging | ||
- trying | ||
pull_request: | ||
merge_group: | ||
jobs: | ||
build_and_push: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
docker_image_name: | ||
- proj-ci | ||
- proj-ci-without-system-proj | ||
- libproj-builder | ||
- geo-ci | ||
rust_version: [1.69] | ||
proj_version: [9.4.0] | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set Up Builder | ||
run: | | ||
docker buildx create --name mybuilder | ||
docker buildx use mybuilder | ||
docker buildx inspect --bootstrap | ||
- name: Build Dockerfile | ||
uses: docker/build-push-action@v5 | ||
with: | ||
run: echo "$PWD/.." >> $GEORUST_ROOT | ||
run echo "docker run -v $(GEORUST_ROOT):/tmp/georust -e CARGO_TARGET_DIR=/tmp/cargo-target" >> $RUN_CMD | ||
file: ./dockerfiles/${{ matrix.docker_image_name }} | ||
push: false | ||
tags: ${{ github.repository_owner }}/${{ matrix.docker_image_name }}:proj-${{ matrix.proj_version }}-rust-${{ matrix.rust_version }} | ||
outputs: type=docker,dest=/tmp/${{ matrix.docker_image_name }}-proj-${{ matrix.proj_version }}-rust-${{ matrix.rust_version }}.tar | ||
build-args: | | ||
RUST_VERSION=${{ matrix.rust_version }} | ||
PROJ_VERSION=${{ matrix.proj_version }} | ||
- name: Test image | ||
run: | | ||
$RUN_CMD -w ${{ github.repository_owner }}/${{ matrix.docker_image_name }}:proj-${{ matrix.proj_version }}-rust-${{ matrix.rust_version }} /bin/bash -c "cargo test" | ||
- name: Upload Image | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
retention-days: 1 | ||
name: ${{ matrix.docker_image_name }}-proj-${{ matrix.proj_version }}-rust-${{ matrix.rust_version }} | ||
path: /tmp/${{ matrix.docker_image_name }}-proj-${{ matrix.proj_version }}-rust-${{ matrix.rust_version }}.tar | ||