Skip to content

Commit

Permalink
Merge pull request #1 from Ouest-France/CI
Browse files Browse the repository at this point in the history
Add Github Ci
  • Loading branch information
pablo-ruth authored Oct 15, 2019
2 parents 13c36ee + 91cc2d8 commit a8a0ba7
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR
on: [pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Build
run: go build -o k8s-vault-webhook

- name: Setup Lint
run: curl -LO https://github.com/golangci/golangci-lint/releases/download/v1.19.1/golangci-lint-1.19.1-linux-amd64.tar.gz && tar -xf golangci-lint-1.19.1-linux-amd64.tar.gz

- name: Lint
run: golangci-lint-1.19.1-linux-amd64/golangci-lint run
41 changes: 41 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tag
on:
push:
tags:
- "v*.*.*"

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Build
run: go build -o k8s-vault-webhook -ldflags="-X github.com/Ouest-France/k8s-vault-webhook/cmd.version=${{ steps.get_version.outputs.VERSION }}"

- name: Setup Lint
run: curl -LO https://github.com/golangci/golangci-lint/releases/download/v1.19.1/golangci-lint-1.19.1-linux-amd64.tar.gz && tar -xf golangci-lint-1.19.1-linux-amd64.tar.gz

- name: Lint
run: golangci-lint-1.19.1-linux-amd64/golangci-lint run

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: k8s-vault-webhook
asset_name: k8s-vault-webhook
tag: ${{ github.ref }}
overwrite: true

0 comments on commit a8a0ba7

Please sign in to comment.