Use golang image to run tests step
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
This commit is contained in:
parent
e7acdabc79
commit
27420c0454
|
@ -0,0 +1,12 @@
|
|||
FROM golang:1.15-alpine
|
||||
|
||||
# Add any build or testing essential system packages
|
||||
RUN apk add --no-cache build-base git
|
||||
|
||||
# Use the GitHub Actions uid:gid combination for proper fs permissions
|
||||
RUN addgroup -g 116 -S test && adduser -u 1001 -S -g test test
|
||||
|
||||
# Run as test user
|
||||
USER test
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "-c"]
|
|
@ -0,0 +1,12 @@
|
|||
name: 'Run tests'
|
||||
description: 'Run tests in docker container'
|
||||
inputs:
|
||||
command:
|
||||
description: 'Command to run inside the container'
|
||||
required: true
|
||||
default: 'make test'
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
args:
|
||||
- ${{ inputs.command }}
|
|
@ -15,14 +15,10 @@ jobs:
|
|||
- name: Restore Go cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
path: /home/runner/work/_temp/_github_home/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.15.x
|
||||
- name: Setup Kubernetes
|
||||
uses: engineerd/setup-kind@v0.5.0
|
||||
- name: Setup Kustomize
|
||||
|
@ -32,8 +28,9 @@ jobs:
|
|||
- name: Setup Helm
|
||||
uses: fluxcd/pkg/actions/helm@main
|
||||
- name: Run tests
|
||||
run: make test
|
||||
uses: ./.github/actions/run-tests
|
||||
env:
|
||||
GOPATH: /github/home/go
|
||||
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
|
||||
- name: Check if working tree is dirty
|
||||
run: |
|
||||
|
|
Loading…
Reference in New Issue