Skip to content

Commit

Permalink
Run unit tests in CI
Browse files Browse the repository at this point in the history
Create a new github actions which runs cargo-test in the `libs`-folder.

Created a new rule check-all in the `Makefile` than can be used to run
both integration and unit tests
  • Loading branch information
ErikDeSmedt authored and cdecker committed Sep 11, 2023
1 parent eafb7b4 commit 41415a4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/rust-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Rust Unit Test

on:
pull_request:
types:
- synchronize
- opened
workflow_dispatch:
merge_group:

jobs:
unit_test:
name: Rust unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: arduino/setup-protoc@v2
with:
version: "23.2" # Fixed since we mount the path below
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: (cd libs; cargo test)
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ build-self: ensure-docker
(cd libs; cargo build --all)
(cd libs/gl-client-py && python3 -m maturin develop)

check-all: check-self check-self-gl-client check-py check-js

check-self: ensure-docker
PYTHONPATH=/repo/libs/gl-testing \
pytest -vvv \
Expand Down Expand Up @@ -102,6 +104,13 @@ docker-check-self:
-v ${REPO_ROOT}:/repo \
gltesting make build-self check-self

docker-check-all:
docker run \
-t \
--rm \
-v ${REPO_ROOT}:/repo \
gltesting make build-self check-all

docker-check:
docker run \
-t \
Expand Down
3 changes: 3 additions & 0 deletions libs/gl-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ check-rs:

clean-rs:
cd libs; cargo clean

check-self-gl-client:
(cd libs/gl-client; cargo test)

0 comments on commit 41415a4

Please sign in to comment.