wip
This commit is contained in:
28
cereal/.github/workflows/repo.yml
vendored
Normal file
28
cereal/.github/workflows/repo.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: repo
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 15 * * 2"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
pre-commit-autoupdate:
|
||||
name: pre-commit autoupdate
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: ghcr.io/commaai/cereal:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: pre-commit autoupdate
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
pre-commit autoupdate
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@5b4a9f6a9e2af26e5f02351490b90d01eb8ec1e5
|
||||
with:
|
||||
token: ${{ secrets.ACTIONS_CREATE_PR_PAT }}
|
||||
commit-message: Update pre-commit hook versions
|
||||
title: 'pre-commit: autoupdate hooks'
|
||||
branch: pre-commit-updates
|
||||
base: master
|
||||
delete-branch: true
|
||||
61
cereal/.github/workflows/tests.yml
vendored
Normal file
61
cereal/.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: tests
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
DOCKER_REGISTRY: ghcr.io/commaai
|
||||
RUN: docker run -e PYTHONWARNINGS=error --shm-size 1G --name cereal cereal /bin/sh -c
|
||||
RUN_NAMED: docker run -e PYTHONWARNINGS=error --shm-size 1G --rm cereal /bin/sh -c
|
||||
CI_RUN: docker run -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID --rm cerealci /bin/bash -c
|
||||
BUILD: docker buildx build --pull --load --cache-to type=inline --cache-from $DOCKER_REGISTRY/cereal:latest -t cereal -f Dockerfile .
|
||||
PYTHONWARNINGS: error
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Push to dockerhub
|
||||
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/cereal'
|
||||
run: |
|
||||
docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
|
||||
docker tag cereal $DOCKER_REGISTRY/cereal:latest
|
||||
docker push $DOCKER_REGISTRY/cereal:latest
|
||||
|
||||
unit_tests:
|
||||
name: unit tests
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
flags: ['', '--asan', '--ubsan']
|
||||
backend: ['MSGQ', 'ZMQ']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build docker image
|
||||
run: eval "$BUILD"
|
||||
- name: C++ tests
|
||||
run: |
|
||||
$RUN "export ${{ matrix.backend }}=1 && \
|
||||
scons ${{ matrix.flags }} -j$(nproc) && \
|
||||
messaging/test_runner && \
|
||||
visionipc/test_runner"
|
||||
- name: python tests
|
||||
run: $RUN_NAMED "${{ matrix.backend }}=1 coverage run -m unittest discover ."
|
||||
- name: Upload coverage
|
||||
run: |
|
||||
docker commit cereal cerealci
|
||||
$CI_RUN "cd /project/cereal && bash <(curl -s https://codecov.io/bash) -v -F unit_tests_${{ matrix.backend }}"
|
||||
|
||||
static_analysis:
|
||||
name: static analysis
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Static analysis
|
||||
# TODO: a package pre-commit installs has a warning, remove the unset once that's fixed
|
||||
run: $RUN "git init && git add -A && unset PYTHONWARNINGS && pre-commit run --all"
|
||||
Reference in New Issue
Block a user