Skip to content

Commit

Permalink
ci: Use dev container in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-caspers committed Jul 3, 2024
1 parent 364feb1 commit 4743ec4
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ env:
jobs:
format_code:
uses: ./.github/workflows/ci_format_code.yml
lint:
uses: ./.github/workflows/ci_lint.yml
build_dev_container:
uses: ./.github/workflows/ci_build_dev_container.yml
build:
needs: build_dev_container
uses: ./.github/workflows/ci_build.yml
test:
needs: build_dev_container
uses: ./.github/workflows/ci_test.yml
lint:
needs: build_dev_container
uses: ./.github/workflows/ci_lint.yml
21 changes: 21 additions & 0 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI Build
'on':
workflow_call: null
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo build
uses: devcontainers/[email protected]
with:
cacheFrom: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
runCmd: cargo build --verbose
push: never
22 changes: 22 additions & 0 deletions .github/workflows/ci_build_dev_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI build dev container
'on':
workflow_call: null
jobs:
build_dev_container:
runs-on: ubuntu-latest
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pre-build dev container image
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
cacheFrom: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
push: filter
refFilterForPush: refs/heads/main
12 changes: 11 additions & 1 deletion .github/workflows/ci_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ jobs:
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo Clippy
run: cargo clippy --all-targets --all-features -- -Dwarnings
uses: devcontainers/[email protected]
with:
cacheFrom: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
runCmd: cargo clippy --all-targets --all-features -- -Dwarnings
push: never
12 changes: 11 additions & 1 deletion .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ jobs:
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo test
run: cargo test --verbose
uses: devcontainers/[email protected]
with:
cacheFrom: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
runCmd: cargo test --verbose
push: never
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![CI](https://github.com/vorausrobotik/voraus-ros-bridge/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/vorausrobotik/voraus-ros-bridge/actions/workflows/ci.yml)

# voraus-ros-bridge

Enables `voraus.core` integration within the ROS framework.
Expand Down

0 comments on commit 4743ec4

Please sign in to comment.