Build rust test image #33
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 rust test image | |
on: | |
workflow_dispatch: | |
inputs: | |
rust_version: | |
description: "Rust version to install" | |
default: "1.70" | |
type: string | |
github_runner_version: | |
description: "Github Runner Version" | |
default: "2.311.0" | |
type: string | |
additional_tag: | |
description: "Additional tag for docker building" | |
default: "latest" | |
type: string | |
context: | |
type: string | |
default: https://github.com/ForesightMiningSoftwareCorporation/github.git#v1:docker/rust-tests | |
workflow_call: | |
inputs: | |
rust_version: | |
description: "Rust version to install" | |
default: "1.70" | |
type: string | |
github_runner_version: | |
description: "Github Runner Version" | |
default: "2.311.0" | |
type: string | |
context: | |
type: string | |
default: https://github.com/ForesightMiningSoftwareCorporation/github.git#v1:docker/rust-tests | |
jobs: | |
build-rust-test-image: | |
runs-on: ubuntu-latest | |
if: ${{ inputs.rust_version != 'none' }} | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
- name: Login to ACR | |
uses: docker/#-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Build and Push Image with Cache | |
- name: Build & Push | |
uses: docker/build-push-action@v3 | |
with: | |
context: ${{ inputs.context }} | |
push: true | |
build-args: | | |
RUST_VERSION=${{ inputs.rust_version }} | |
GITHUB_RUNNER_VERSION=${{ inputs.github_runner_version }} | |
ADDITIONAL_CMD=${{ contains(inputs.rust_version, 'nightly') && 'rustup component add miri' || '' }} | |
tags: | | |
ghcr.io/foresightminingsoftwarecorporation/rust-test:${{ inputs.rust_version }} | |
${{ inputs.additional_tag && format('ghcr.io/foresightminingsoftwarecorporation/rust-test:{0}', inputs.additional_tag) || '' }} |