mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-16 16:37:01 +00:00
Github Action simple CI
This commit is contained in:
parent
c4ab3e29b2
commit
bc3d13148e
4 changed files with 21 additions and 43 deletions
32
.github/workflows/main.yml
vendored
32
.github/workflows/main.yml
vendored
|
|
@ -1,33 +1,17 @@
|
||||||
# This is a basic workflow to help you get started with Actions
|
name: build
|
||||||
|
|
||||||
name: CI
|
on: push
|
||||||
|
|
||||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
||||||
# events but only for the master branch
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
||||||
jobs:
|
jobs:
|
||||||
# This workflow contains a single job called "build"
|
|
||||||
build:
|
build:
|
||||||
# The type of runner that the job will run on
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
||||||
steps:
|
steps:
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
- name: checkout
|
||||||
- uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# Runs a single command using the runners shell
|
- name: test
|
||||||
- name: Run a one-line script
|
run: make docker-test
|
||||||
run: echo Hello, world!
|
|
||||||
|
|
||||||
# Runs a set of commands using the runners shell
|
- name: build
|
||||||
- name: Run a multi-line script
|
run: make docker-build-static
|
||||||
run: |
|
|
||||||
echo Add other actions to build,
|
|
||||||
echo test, and deploy your project.
|
|
||||||
13
Makefile
13
Makefile
|
|
@ -1,10 +1,19 @@
|
||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
build:
|
test-build: test build
|
||||||
go build -o bin/kubeconform
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test ./...
|
go test ./...
|
||||||
|
|
||||||
|
build:
|
||||||
|
go build -o bin/kubeconform
|
||||||
|
|
||||||
build-static:
|
build-static:
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o bin/kubeconform
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o bin/kubeconform
|
||||||
|
|
||||||
|
docker-test:
|
||||||
|
docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.14 make test
|
||||||
|
|
||||||
|
docker-build-static:
|
||||||
|
docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.14 make build-static
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
# Kubeconform
|
# Kubeconform
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
Kubeconform is a Kubernetes manifests validation tool. Build it into your CI to validate your Kubernetes
|
Kubeconform is a Kubernetes manifests validation tool. Build it into your CI to validate your Kubernetes
|
||||||
configuration using the schemas from the registry maintained by the
|
configuration using the schemas from the registry maintained by the
|
||||||
[kubernetes-json-schema](https://github.com/instrumenta/kubernetes-json-schema) project!
|
[kubernetes-json-schema](https://github.com/instrumenta/kubernetes-json-schema) project!
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
name: kubeconform
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: docker-build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: docker-build
|
|
||||||
run: |
|
|
||||||
docker build -t kubeconform .
|
|
||||||
Loading…
Reference in a new issue