[CI/CD] Run tests

This commit is contained in:
Cyrille Nofficial 2021-01-23 15:21:19 +01:00
parent e819f61d1b
commit 22bb66e34a
2 changed files with 46 additions and 8 deletions

View File

@ -14,22 +14,31 @@ on:
tags:
- v*
# Run tests for any PRs.
pull_request:
env:
IMAGE_REPOSITORY: cyrilix
IMAGE_NAME: robocar-simulator
PLATFORMS: linux/arm64,linux/amd64,linux/arm/v7
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15'
- name: test
run: go test ./...
- name: vet
run: go vet ./...
# Push image to GitHub Package Registry.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: test
steps:
- uses: actions/checkout@v2

29
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Tests
on:
push:
# Publish `master` as Docker `latest` image.
branches:
tags:
# Run tests for any PRs.
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15'
- name: test
run: go test ./...
- name: vet
run: go vet ./...