File tree Expand file tree Collapse file tree 5 files changed +42
-19
lines changed Expand file tree Collapse file tree 5 files changed +42
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ ---
2+ name : Rust Format and Clippy
3+
4+ on :
5+ push :
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ lint :
11+ runs-on : ubuntu-latest
12+
13+ container :
14+ image : ghcr.io/nationalsecurityagency/seabee:build
15+
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v4
19+
20+ - name : Check formatting
21+ run : cargo fmt -- --check
22+
23+ - name : Run Clippy
24+ run : cargo clippy --all-targets --all-features --no-deps
Original file line number Diff line number Diff line change 11ARG DOCKER_MIRROR
22
3- FROM ${DOCKER_MIRROR}rust:1.79.0- slim
3+ FROM ${DOCKER_MIRROR}rust:slim
44
5- COPY scripts/update_root_dependencies.sh /scripts/update_root_dependencies.sh
6- COPY scripts/update_test_dependencies.sh /scripts/update_test_dependencies.sh
7- COPY scripts/update_dependencies.sh /scripts/update_dependencies.sh
5+ LABEL org.opencontainers.image.source=https://github.com/NationalSecurityAgency/seabee
6+
7+ COPY scripts /scripts
88
99RUN DOCKER=1 /scripts/update_dependencies.sh \
1010 && rm -rf /var/lib/apt/lists/*
Original file line number Diff line number Diff line change @@ -5,17 +5,22 @@ TOP_DIR=$(dirname "$(dirname "$(realpath "$0" || true)")")
55ASCIINEMA_VERSION=2.4.0
66POETRY_VERSION=1.8.3
77PYTHON_VERSION=3.9
8- RUST_VERSION=1.79.0
98
109ASCIINEMA=asciinema
1110export DOCKER=" ${DOCKER:- 0} "
1211POETRY=poetry
1312PYTHON=python3
1413RUSTUP=" $HOME /.cargo/bin/rustup"
1514
15+ # Docker container doesn't have sudo
16+ SUDO=" sudo"
17+ if [ " $DOCKER " -eq 1 ]; then
18+ SUDO=" "
19+ fi
20+
1621if [ " $EUID " -eq 0 ] && [ " $DOCKER " -eq 0 ]; then
1722 printf " Please don't run this script as root or sudo\n"
18- exit
23+ exit 1
1924fi
2025
2126# https://unix.stackexchange.com/a/567537
@@ -45,11 +50,14 @@ python_check() {
4550 source " $HOME /.bashrc" && poetry install
4651}
4752
53+ # install the latest stable verison of rust
4854rust_check () {
4955 if ! command -V " $RUSTUP " & > /dev/null; then
5056 printf " Rustup not detected. Installing...\n"
51- curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile default --default-toolchain $RUST_VERSION -y
57+ curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile default stable -y
5258 fi
59+ # Install rust lints
60+ rustup component add rustfmt clippy
5361}
5462
5563autocast_check () {
@@ -58,7 +66,7 @@ autocast_check() {
5866 fi
5967}
6068
61- sudo " $TOP_DIR " /scripts/update_root_dependencies.sh
69+ $SUDO " $TOP_DIR " /scripts/update_root_dependencies.sh
6270python_check
6371rust_check
6472autocast_check
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ version_greater_equal() {
2121os_check () {
2222 ID=$( grep " ^ID=" /etc/os-release | cut -d= -f2 | tr -d " \" " )
2323 case $ID in
24- ubuntu)
24+ ubuntu | debian )
2525 USE_APT=1
2626 ;;
2727 fedora | rocky)
@@ -34,7 +34,7 @@ os_check() {
3434install_system_packages () {
3535 printf " Installing tools and libraries needed for development\n"
3636 local common_deps
37- common_deps=(clang pipx python3 python3-pip strace)
37+ common_deps=(clang make pipx python3 python3-pip strace)
3838 # depedencies necessary to build static libraries for libelf and zlib
3939 # which are dependencies of libbpf which is also built statically
4040 local library_deps library_deps_deb library_deps_dnf
You can’t perform that action at this time.
0 commit comments