From 741d7da3080ed6e1a3b5d5811d7bc9d18a6f0647 Mon Sep 17 00:00:00 2001 From: Philipp Caspers Date: Thu, 13 Jun 2024 07:16:55 +0000 Subject: [PATCH] WIP: ci: Add github action for basic CI --- .devcontainer/Dockerfile | 3 +++ .github/workflows/ci.yml | 57 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index afaea8f..4bcf6f5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -31,6 +31,9 @@ RUN echo "source /opt/ros/humble/setup.sh" >> /root/.bashrc RUN . /opt/ros/humble/setup.sh && colcon build RUN echo "source /ros_deps/install/setup.sh" >> /root/.bashrc +ENV CARGO_TERM_COLOR=always +ENV RUSTFLAGS="-Dwarnings" + RUN mkdir -p /workspace WORKDIR /workspace diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8e81280 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +name: Build Test Lint + +on: + push: + pull_request: + + + +jobs: + build_and_test: + runs-on: ubuntu-latest + steps: + + - name: Checkout (GitHub) + uses: actions/checkout@v4 + + - name: Cargo build and test + uses: devcontainers/ci@v0.3 + with: + runCmd: cargo build --verbose + runCmd: cargo test --verbose + + lint: + runs-on: ubuntu-latest + steps: + + - name: Checkout (GitHub) + uses: actions/checkout@v4 + + - name: Cargo Clippy + uses: devcontainers/ci@v0.3 + with: + runCmd: cargo clippy --all-targets --all-features + +# jobs: + +# build_and_test: +# name: Build and Test +# runs-on: ubuntu-latest +# strategy: +# matrix: +# toolchain: +# - stable +# - beta +# - nightly +# steps: +# - uses: actions/checkout@v3 +# - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} +# - run: cargo build --verbose +# - run: cargo test --verbose +# lint: +# name: clippy check +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Run Clippy +# run: cargo clippy --all-targets --all-features