-
Notifications
You must be signed in to change notification settings - Fork 77
34 lines (30 loc) · 1.11 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: tests
on: [push, pull_request]
env:
REGISTRY: ghcr.io/commaai
BUILD: docker buildx build --pull --load --cache-to type=inline --cache-from $REGISTRY/rednose:latest -t rednose -f Dockerfile .
RUN: docker run rednose bash -c
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Build docker image
run: eval ${{ env.BUILD }}
- name: Static analysis
run: ${{ env.RUN }} "git init && git add -A && pre-commit run --all"
- name: Unit Tests
run: ${{ env.RUN }} "cd /project/examples; python -m unittest discover"
docker_push:
name: docker push
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/rednose_repo'
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: eval ${{ env.BUILD }}
- name: Push to dockerhub
run: |
docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
docker tag rednose ${{ env.REGISTRY }}/rednose:latest
docker push ${{ env.REGISTRY }}/rednose:latest