From 1480bea3af47f64f6b6b244c5b91825c917bd813 Mon Sep 17 00:00:00 2001 From: chrysn Date: Tue, 17 Jan 2023 14:02:49 +0100 Subject: [PATCH] Build extra riotdocker variant that includes nightly Rust --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ riotbuild-rustnightly/Dockerfile | 20 ++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 riotbuild-rustnightly/Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0879c673..c6979131 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/riotbuild-rustnightly/Dockerfile b/riotbuild-rustnightly/Dockerfile new file mode 100644 index 00000000..ace32401 --- /dev/null +++ b/riotbuild-rustnightly/Dockerfile @@ -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