Skip to content

Commit

Permalink
ci: Split up GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-caspers committed Jun 13, 2024
1 parent 0427eb5 commit ff88e02
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 50 deletions.
59 changes: 9 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,16 @@
name: Build Test Lint
name: CI

on:
push:
pull_request:

jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
build_dev_container:
uses: ./.github/workflows/ci_build_dev_container.yml
build:
uses: ./.github/workflows/ci_build.yml
test:
uses: ./.github/workflows/ci_test.yml
lint:
uses: ./.github/workflows/ci_lint.yml

- 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 and test
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
runCmd: |
cargo build --verbose
cargo test --verbose
# - name: Cargo Clippy
# uses: devcontainers/[email protected]
# 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
25 changes: 25 additions & 0 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI Build

on:
workflow_call:

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:
imageName: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
runCmd: cargo build --verbose
23 changes: 23 additions & 0 deletions .github/workflows/ci_build_devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI build dev container

on:
workflow_call:

jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- 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: always
25 changes: 25 additions & 0 deletions .github/workflows/ci_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI Lint

on:
workflow_call:

jobs:
lint:
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 Clippy
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
runCmd: cargo clippy --all-targets --all-features
25 changes: 25 additions & 0 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI Test

on:
workflow_call:

jobs:
test:
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 test
uses: devcontainers/[email protected]
with:
imageName: ghcr.io/vorausrobotik/voraus-ros-bridge-dev
runCmd: cargo test --verbose

0 comments on commit ff88e02

Please sign in to comment.