Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
83d7e43
feat: add rust container flavor
rjaegers Mar 8, 2024
6903799
ci: fix linter findings
rjaegers Mar 12, 2024
d1de73e
Merge commit '8653908d77e6bf47652fce63ac10c1275999ea21' into feature/…
rjaegers Mar 12, 2024
a8e77e9
ci: ignore some linter findings
rjaegers Mar 12, 2024
0c5ea47
ci: run for all flavours
rjaegers Mar 12, 2024
1ee4e43
ci: fix tests for rust container flavor
rjaegers Mar 13, 2024
51d825d
Merge commit 'e25462503773386be342066d81c04bf25451e0c3' into feature/…
rjaegers Mar 13, 2024
27be8ef
chore: add pkg-config
rjaegers Mar 13, 2024
54e9106
ci: fix linter findings
rjaegers Mar 13, 2024
945ade2
Merge branch 'main' into feature/add-rust-container-flavor
rjaegers Mar 13, 2024
a63dc83
chore: modify build and push workflow for flavors
rjaegers Mar 13, 2024
ddfd6fb
Merge branch 'feature/add-rust-container-flavor' of https://github.co…
rjaegers Mar 13, 2024
1c7ec58
chore: reduce container size
rjaegers Mar 14, 2024
1a4ff0d
chore: add Docker extension to devcontainer.json
rjaegers Mar 15, 2024
b3f060c
Merge commit 'aa28065477dd5a4da08f8ed882382467d362f1b5' into feature/…
rjaegers Apr 15, 2024
87fd45a
chore: update rust from 1.76.0 to 1.77.2
rjaegers Apr 16, 2024
02c8814
ci: publish result of all testsuites
rjaegers Apr 16, 2024
8f82719
ci: fix duplicate artifact
rjaegers Apr 16, 2024
4eff8f7
Update ci.yml
rjaegers Apr 16, 2024
e9ff8ff
ci: different fix for multiple artifacts
rjaegers Apr 16, 2024
963df19
Merge commit '07dcd6647b97d99fafbe3fa71b902b5bd902222b' into feature/…
rjaegers Apr 16, 2024
8358a7f
ci: update all automation to cope with multiple containers
rjaegers Apr 17, 2024
046e847
chore: move update-apt-packages to own action
rjaegers Apr 17, 2024
a8a988e
chore: add flip-link package
rjaegers Apr 17, 2024
70053ce
Merge branch 'main' into feature/add-rust-container-flavor
rjaegers Apr 20, 2024
0cf302e
Merge commit '80383bdc90f68dc545d2923cbbdb33af4ec9be5c' into feature/…
rjaegers Apr 22, 2024
e028650
chore: process review comments
rjaegers Apr 22, 2024
b505db7
chore: merge the -vscode image into the main image
rjaegers Apr 22, 2024
60314f1
Update build-push.yml
rjaegers Apr 22, 2024
7a48e06
Merge commit '111f15a671d35ed3ccbfc57d7312a2a7885aae32' into feature/…
rjaegers May 6, 2024
dead322
chore: minor fix after merge
rjaegers May 6, 2024
5d83980
chore: move Rust container to Ubuntu 24.04
rjaegers May 6, 2024
2d31f95
chore: update Rust to latest version
rjaegers May 6, 2024
a8c6417
chore: update Docker cli from 25.0.3 to 26.1.1
rjaegers May 7, 2024
74d209b
chore: add more test for Rust container
rjaegers May 7, 2024
de80096
chore: reduce duplication in test code
rjaegers May 7, 2024
269b613
chore: add test for coverage
rjaegers May 7, 2024
62add84
chore: remove unused bats tags
rjaegers May 7, 2024
8501790
chore: don't use run in bats tests when not needed
rjaegers May 7, 2024
a5dd48c
chore: add mutation testing support to Rust container
rjaegers May 7, 2024
6011a60
chore: correct test name to beter reflect its actual scope
rjaegers May 7, 2024
4c44ac0
docs: update documentation
rjaegers May 8, 2024
e7e6d74
Merge commit '5804c2b607a69b190cfadc7136a25b31fa4aaab2' into feature/…
rjaegers May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile → .devcontainer/cpp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ HEALTHCHECK NONE
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install the base system with all tool dependencies
COPY .devcontainer/apt-requirements-base.json /tmp/apt-requirements-base.json
COPY .devcontainer/cpp/apt-requirements-base.json /tmp/apt-requirements-base.json
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends jq \
&& jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements-base.json | xargs apt-get install -y --no-install-recommends \
Expand All @@ -27,7 +27,7 @@ RUN wget -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https:/
&& update-ca-certificates

# Install some tools via pip to get more recent versions
COPY .devcontainer/requirements.txt /tmp/requirements.txt
COPY .devcontainer/cpp/requirements.txt /tmp/requirements.txt
RUN python3 -m pip install --require-hashes --no-cache-dir -r /tmp/requirements.txt \
&& rm -rf /tmp/requirements.txt

Expand All @@ -36,7 +36,7 @@ ENV CMAKE_GENERATOR="Ninja"
ENV CMAKE_EXPORT_COMPILE_COMMANDS="On"

# Install clang toolchain
COPY .devcontainer/apt-requirements-clang.json /tmp/apt-requirements-clang.json
COPY .devcontainer/cpp/apt-requirements-clang.json /tmp/apt-requirements-clang.json
# hadolint ignore=SC1091
RUN wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot-keyring.gpg \
&& UBUNTU_CODENAME=$(. /etc/os-release; echo "${UBUNTU_CODENAME/*, /}") \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"build": {
"dockerfile": "Dockerfile",
"context": ".."
"context": "../.."
},
"remoteEnv": {
"CONTAINER_FLAVOR": "cpp"
},
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions .devcontainer/rust/Dockerfile
Comment thread
rjaegers marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM ubuntu:22.04@sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e
Comment thread
rjaegers marked this conversation as resolved.
Outdated

ARG BATS_VERSION=1.10.0
ARG RUST_VERSION=1.76.0

ARG DEBIAN_FRONTEND=noninteractive

HEALTHCHECK NONE

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install the base system with all tool dependencies
COPY .devcontainer/rust/apt-requirements-base.json /tmp/apt-requirements-base.json
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends jq \
&& jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements-base.json | xargs apt-get install -y --no-install-recommends \
&& rm /tmp/apt-requirements-base.json \
&& rm -rf /var/lib/apt/lists/*

# Include the Cisco Umbrella PKI Root
RUN wget -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https://www.cisco.com/security/pki/certs/ciscoumbrellaroot.pem \
&& update-ca-certificates

# Install rust
RUN wget -qO /tmp/rustup-init "https://static.rust-lang.org/rustup/dist/$(uname -m)-unknown-linux-gnu/rustup-init" \
&& chmod +x /tmp/rustup-init \
&& /tmp/rustup-init -qy --default-toolchain=${RUST_VERSION} --component llvm-tools --target thumbv7em-none-eabi \
&& rm -rf /tmp/rustup-init

# See https://github.com/moby/moby/issues/28971 why we can't use $HOME here
ENV PATH="/root/.cargo/bin:$PATH"

# Install bats
RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \
&& wget -qO - "https://github.com/bats-core/bats-core/archive/refs/tags/v${BATS_VERSION}.tar.gz" | tar xz -C "${batstmp}" \
&& bash "${batstmp}/bats-core-${BATS_VERSION}/install.sh" /usr/local \
&& rm -rf "${batstmp}" \
&& git -C /usr/local clone -b v0.3.0 https://github.com/bats-core/bats-support.git \
&& git -C /usr/local clone -b v2.1.0 https://github.com/bats-core/bats-assert.git

# Update all tool alternatives to the correct version
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-12 20 \
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-12 20

# hadolint ignore=DL3008
RUN apt-get update \
Comment thread Fixed
&& apt-get install -y --no-install-recommends libudev-dev \
&& cargo install cargo-binutils \
&& cargo install probe-rs --features cli \
&& rm -rf $HOME/.cargo/registry \
&& apt-get purge -y libudev-dev \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
8 changes: 8 additions & 0 deletions .devcontainer/rust/apt-requirements-base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"ca-certificates": "20230311ubuntu0.22.04.1",
"g++-12": "12.3.0-1ubuntu1~22.04",
"git": "1:2.34.1-1ubuntu1.10",
"gnupg2": "2.2.27-3ubuntu2.1",
"pkg-config": "0.29.2-1ubuntu3",
"wget": "1.21.2-2ubuntu1"
}
18 changes: 18 additions & 0 deletions .devcontainer/rust/devcontainer-metadata-vscode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
},
"customizations": {
"vscode": {
"extensions": [
"mhutchie.git-graph@1.30.0",
"ms-vsliveshare.vsliveshare@1.0.5905",
"rust-lang.rust-analyzer@0.3.1868",
"tamasfe.even-better-toml@0.19.2",
"usernamehw.errorlens@3.16.0"
]
}
}
}
]
26 changes: 26 additions & 0 deletions .devcontainer/rust/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"build": {
"dockerfile": "Dockerfile",
"context": "../.."
},
"privileged": true,
"remoteEnv": {
"CONTAINER_FLAVOR": "rust"
},
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"customizations": {
"vscode": {
"extensions": [
"tamasfe.even-better-toml@0.19.2",
"GitHub.vscode-github-actions@0.26.2",
"GitHub.vscode-pull-request-github@0.76.1",
"jetmartin.bats@0.1.10",
"mhutchie.git-graph@1.30.0",
"rust-lang.rust-analyzer@0.3.1868",
"usernamehw.errorlens@3.16.0"
]
}
}
}
7 changes: 7 additions & 0 deletions .devcontainer/rust/test/cargo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .devcontainer/rust/test/cargo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "hello-cargo"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
3 changes: 3 additions & 0 deletions .devcontainer/rust/test/cargo/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
2 changes: 2 additions & 0 deletions .devcontainer/rust/test/cortex-m/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target = "thumbv7em-none-eabi"
Loading