Bump runtime-vm version #69
Workflow file for this run
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: CI | |
on: | |
push: | |
tags: | |
- v* | |
- pre-rel-* | |
env: | |
runtime-vm_repository: golemfactory/ya-runtime-vm | |
runtime-vm_version: pre-rel-v0.4.0-ITL-rc21 | |
vm_name: ya-runtime-vm-nvidia | |
os_name: linux | |
organisation: golemfactory | |
docker-img_name: golem-nvidia-base | |
docker-img_description: Base image with Nvidia drivers for Golem VM images. | |
self-test-img_gvmi: self-test.gvmi | |
jobs: | |
build-golem_nvidia_base: | |
name: Build golem-nvidia-base | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install Musl | |
run: sudo apt-get install -y musl-tools musl | |
- uses: actions/checkout@v1 | |
with: | |
submodules: "recursive" | |
- name: Tag name and version | |
id: tag_name | |
run: | | |
TAG=${GITHUB_REF##*/} | |
VERSION=${TAG#v} | |
VERSION=${VERSION#pre-rel-v} | |
echo "TAG=${TAG}" >> $GITHUB_OUTPUT | |
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./golem_nvidia_base/ | |
push: true | |
# Always create `latest` tag. If not make `self_test_img` to use currently build image. | |
tags: | | |
ghcr.io/${{ env.organisation }}/${{ env.docker-img_name }}:${{ steps.tag_name.outputs.VERSION }} | |
ghcr.io/${{ env.organisation }}/${{ env.docker-img_name }}:${{ startsWith(steps.tag_name.outputs.TAG, 'pre-rel-') && 'beta' || 'stable' }} | |
ghcr.io/${{ env.organisation }}/${{ env.docker-img_name }}:latest | |
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=${{ env.docker-img_description }} | |
build-self-test-img: | |
name: Build self test img | |
needs: | |
- build-golem_nvidia_base | |
runs-on: ubuntu-20.04 | |
env: | |
gvmkit-build_tag: v0.3.13 | |
gvmkit-build_dir: gvmkit-build | |
gvmkit-build_archive: gvmkit-build-x86_64-unknown-linux-gnu.tar.gz | |
self-test-img_tag: self-test | |
rust_stable: 1.70.0 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust ${{ env.rust_stable }} | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ env.rust_stable }} | |
components: rustfmt, clippy | |
- name: Check lockfile | |
uses: actions-rs/cargo@v1 | |
with: | |
command: tree | |
args: --locked | |
- name: Check formatting | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Check clippy lints | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all-targets --all-features --workspace -- -D warnings | |
- name: Unit tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace --locked | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Build Docker image for GPU | |
uses: docker/build-push-action@v4 | |
with: | |
context: self_test_img | |
push: false | |
tags: ${{ env.self-test-img_tag }} | |
- name: Download gvmkit-build | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: robinraju/[email protected] | |
with: | |
repository: golemfactory/gvmkit-build-rs | |
tag: ${{ env.gvmkit-build_tag }} | |
fileName: ${{ env.gvmkit-build_archive }} | |
extract: true | |
out-file-path: ${{ env.gvmkit-build_dir }} | |
tarBall: false | |
zipBall: false | |
- name: Build GVMkit image | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
${{ env.gvmkit-build_dir }}/gvmkit-build ${{ env.self-test-img_tag }}:latest -o ${{ env.self-test-img_gvmi }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: self_test_img | |
path: | | |
${{ env.self-test-img_gvmi }} | |
- name: Download ya-runtime-vm | |
uses: robinraju/[email protected] | |
with: | |
repository: ${{ env.runtime-vm_repository }} | |
tag: ${{ env.runtime-vm_version }} | |
fileName: ya-runtime-vm-${{ env.os_name }}-${{ env.runtime-vm_version }}.tar.gz | |
extract: true | |
out-file-path: . | |
tarBall: false | |
zipBall: false | |
- name: Build .deb | |
id: deb | |
run: | | |
chmod +x debian/build-deb.sh | |
./debian/build-deb.sh ${{ github.ref }} ${{ env.self-test-img_gvmi }} ya-runtime-vm-${{ env.os_name }}-${{ env.runtime-vm_version }}/ya-runtime-vm | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: deb | |
path: | | |
${{ steps.deb.outputs.deb }} | |
release: | |
name: Release | |
needs: | |
- build-self-test-img | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: deb | |
path: dist/ | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: dist/* | |
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-rel-v') }} |