Skip to content

Commit

Permalink
Faster CI (commaai#68)
Browse files Browse the repository at this point in the history
* move tests into their own jobs

* add CI badge to README

* fix name
  • Loading branch information
adeebshihadeh committed Jul 27, 2020
1 parent 99289eb commit c176b01
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
49 changes: 35 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: tests

on: [push, pull_request]

Expand All @@ -10,29 +10,51 @@ env:
docker build --cache-from docker.io/commaai/cereal:latest -t cereal -f Dockerfile .
jobs:
test:
name: tests
build:
name: build
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: eval "$BUILD"
- name: Unit Tests
run: |
$RUN "scons --test --asan -j$(nproc) && messaging/test_runner"
- name: Test ZMQ
run: |
$RUN "ZMQ=1 python -m unittest discover ."
- name: Test MSGQ
run: |
$RUN "MSGQ=1 python -m unittest discover ."
- name: Push to dockerhub
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/cereal'
run: |
docker login -u wmelching -p ${{ secrets.COMMA_DOCKERHUB_TOKEN}}
docker tag cereal docker.io/commaai/cereal:latest
docker push docker.io/commaai/cereal:latest
unit_tests:
name: unit tests
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: eval "$BUILD"
- name: Unit Tests
run: |
$RUN "scons --test --asan -j$(nproc) && messaging/test_runner"
test_zmq:
name: zmq
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: eval "$BUILD"
- name: Test ZMQ
run: $RUN "ZMQ=1 python -m unittest discover ."

test_msgq:
name: msgq
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: eval "$BUILD"
- name: Test MSGQ
run: $RUN "MSGQ=1 python -m unittest discover ."

static_analysis:
name: static analysis
runs-on: ubuntu-16.04
Expand All @@ -41,5 +63,4 @@ jobs:
- name: Build docker image
run: eval "$BUILD"
- name: Static analysis
run: |
$RUN "git init && git add -A && pre-commit run --all"
run: $RUN "git init && git add -A && pre-commit run --all"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
What is cereal?
What is cereal? ![test status](https://github.com/commaai/cereal/workflows/Tests/badge.svg?event=push)
----

cereal is both a messaging spec for robotics systems as well as generic high performance IPC pub sub messaging with a single publisher and multiple subscribers.
Expand Down

0 comments on commit c176b01

Please sign in to comment.