Skip to content

Commit

Permalink
Build extra riotdocker variant that includes nightly Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Jan 17, 2023
1 parent fe50bda commit 1480bea
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,31 @@ jobs:
build-args: |
DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }}
- name: Build riotbuild-rustnightly
uses: docker/build-push-action@v2
with:
context: ./riotbuild-rustnightly
tags: |
${{ env.DOCKER_REGISTRY }}/riotbuild-rustnightly:latest
${{ env.DOCKER_REGISTRY }}/riotbuild-rustnightly:${{ env.VERSION_TAG }}
build-args: |
DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }}
- name: Rust build test on Rust nightly
run: |
# Some of the above are executed by root, creating ~/.cargo/git as
# that user, blocking downloads of own libraries.
rm -rf ~/.cargo
make -CRIOT/examples/rust-hello-world BUILDTEST_MAKE_REDIRECT='' buildtest CARGO_CHANNEL=nightly
make -CRIOT/examples/rust-gcoap BUILDTEST_MAKE_REDIRECT='' buildtest CARGO_CHANNEL=nightly
env:
BUILD_IN_DOCKER: 1
DOCKER_IMAGE: ${{ env.DOCKER_REGISTRY }}/riotbuild-rustnightly:latest
# Not all of them are actually available; still using the "canonical"
# list of representative boards above to keep this stable whil Rust
# support expands
BOARDS: "arduino-uno esp32-wroom-32 hifive1b msb-430h native samr21-xpro"

- name: Login to DockerHub
if: "${{ github.ref == 'refs/heads/master' }}"
uses: docker/login-action@v1
Expand Down
20 changes: 20 additions & 0 deletions riotbuild-rustnightly/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Dockerfile for RIOT build environments with extra Rust nightly
#
# The resulting image will be based on riotdocker, but also install the current
# RIOT nightly versions to enable easy building of applications that need
# nightly.

ARG DOCKER_REGISTRY="docker.io/riot"
FROM ${DOCKER_REGISTRY}/riotbuild:latest

# For the value of CARGO_HOME, see the comments in riotbuild's Dockerfile.
RUN \
set -ex; \
export CARGO_HOME=/opt/rustup/.cargo; \
rustup toolchain add nightly; \
for target in $(rustup target list --installed); \
do \
rustup target add $target --toolchain nightly; \
done; \
rustup default nightly

0 comments on commit 1480bea

Please sign in to comment.