2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2024-11-22 15:56:24 +00:00

actions: move docs test to its own job

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
Adphi 2022-08-10 11:35:55 +02:00
parent 3f7b5e2805
commit f9aebd77d4
Signed by: adphi
GPG Key ID: F2159213400E50AB
2 changed files with 33 additions and 0 deletions

View File

@ -45,6 +45,35 @@ jobs:
- name: Run tests
run: make tests
docs-up-to-date:
name: Docs up to date
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# fetching all tags is required for the Makefile to compute the right version
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Share cache with other actions
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
/tmp/.buildx-cache
key: ${{ runner.os }}-tests-${{ github.sha }}
restore-keys: |
${{ runner.os }}-tests-
- name: Check if docs are up to date
run: make docs-up-to-date
build:
name: Build
runs-on: ubuntu-latest
@ -155,6 +184,7 @@ jobs:
if: startsWith(github.event.ref, 'refs/tags/v')
needs:
- tests
- docs-up-to-date
- build
steps:
@ -202,6 +232,7 @@ jobs:
if: startsWith(github.event.ref, 'refs/tags/v')
needs:
- tests
- docs-up-to-date
- build-image
steps:

View File

@ -65,6 +65,8 @@ docker-run:
tests:
@go generate ./...
@go list ./...| xargs go test -exec sudo -count=1 -timeout 20m -v
docs-up-to-date:
@$(MAKE) docs
@git diff --quiet docs || (echo "Please regenerate the documentation with 'make docs'"; exit 1)