unit tests

Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Casey Lee
2020-02-10 15:27:05 -08:00
parent be75ee20b1
commit 0582306861
466 changed files with 94683 additions and 62526 deletions

View File

@@ -1,31 +0,0 @@
name: basic
on: push
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
build:
runs-on: ubuntu-latest
container:
image: node:10.16-jessie
env:
NODE_ENV: development
steps:
- run: env
test:
runs-on: ubuntu-latest
needs: [build]
steps:
- run: cp $GITHUB_EVENT_PATH $HOME/foo.json
- run: ls $HOME
- run: cat $HOME/foo.json
- uses: docker://alpine:3.8
with:
args: uname -a
local-action:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/docker-url

9
.github/workflows/check/Dockerfile vendored Normal file
View File

@@ -0,0 +1,9 @@
FROM golangci/golangci-lint:v1.23.6
RUN apt-get install git
COPY "entrypoint.sh" "/entrypoint.sh"
RUN chmod +x /entrypoint.sh
ENV GOFLAGS -mod=vendor
ENTRYPOINT ["/entrypoint.sh"]

8
.github/workflows/check/action.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
name: Check
description: Run static analysis and unit tests
branding:
icon: check-circle
color: green
runs:
using: 'docker'
image: 'Dockerfile'

4
.github/workflows/check/entrypoint.sh vendored Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
set -e
golangci-lint run
go test -cover -short ./...

View File

@@ -1,16 +0,0 @@
name: docker-url
author: nektos
description: testing
inputs:
who-to-greet:
description: who to greet
required: true
default: World
runs:
using: docker
image: docker://alpine:3.8
env:
TEST: enabled
args:
- echo
- ${INPUT_WHO_TO_GREET}

View File

@@ -0,0 +1,7 @@
FROM golangci/golangci-lint:v1.23.6
COPY "entrypoint.sh" "/entrypoint.sh"
RUN chmod +x /entrypoint.sh
ENV GOFLAGS -mod=vendor
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,8 @@
name: Check
description: Run integration tests
branding:
icon: check-circle
color: green
runs:
using: 'docker'
image: 'Dockerfile'

View File

@@ -0,0 +1,3 @@
#!/bin/sh
set -e
go test -cover ./runner

9
.github/workflows/push.yml vendored Normal file
View File

@@ -0,0 +1,9 @@
name: push
on: push
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/check
- uses: ./.github/workflows/integration

20
.github/workflows/tag.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: tag
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/check
- uses: ./.github/workflows/integration
- uses: goreleaser/goreleaser-action@v1
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}