-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from go-vela/workflows
chore: add workflows, clean repo
- Loading branch information
Showing
21 changed files
with
379 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# name of the action | ||
name: build | ||
|
||
# trigger on pull_request or push events | ||
on: | ||
pull_request: | ||
push: | ||
|
||
# pipeline to execute | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.17 | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
|
||
- name: build | ||
run: | | ||
make build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ main ] | ||
schedule: | ||
- cron: '32 7 * * 6' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'go' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
# Learn more: | ||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# name of the action | ||
name: prerelease | ||
|
||
# trigger on push events with `v*` in tag | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
# pipeline to execute | ||
jobs: | ||
prerelease: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.17 | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
with: | ||
# ensures we fetch tag history for the repository | ||
fetch-depth: 0 | ||
|
||
- name: setup | ||
run: | | ||
# setup git tag in Actions environment | ||
echo "GITHUB_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
- name: build | ||
env: | ||
GOOS: linux | ||
CGO_ENABLED: "0" | ||
run: | | ||
make build-static-ci | ||
- name: publish | ||
uses: elgohr/Publish-Docker-Github-Action@master | ||
with: | ||
name: target/vela-ansible | ||
cache: true | ||
tag_names: true | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# name of the action | ||
name: publish | ||
|
||
# trigger on push events with branch main | ||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
# pipeline to execute | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.17 | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
with: | ||
# ensures we fetch tag history for the repository | ||
fetch-depth: 0 | ||
|
||
- name: build | ||
env: | ||
GOOS: linux | ||
CGO_ENABLED: '0' | ||
run: | | ||
make build-static-ci | ||
- name: publish | ||
uses: elgohr/Publish-Docker-Github-Action@master | ||
with: | ||
name: target/vela-ansible | ||
cache: true | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# name of the action | ||
name: reviewdog | ||
|
||
# trigger on pull_request events | ||
on: | ||
pull_request: | ||
|
||
# pipeline to execute | ||
jobs: | ||
diff-review: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.17 | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
|
||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
golangci_lint_flags: "--config=.golangci.yml" | ||
fail_on_error: true | ||
filter_mode: diff_context | ||
reporter: github-pr-review | ||
|
||
full-review: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.17 | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
|
||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
golangci_lint_flags: "--config=.golangci.yml" | ||
fail_on_error: false | ||
filter_mode: nofilter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# name of the action | ||
name: test | ||
|
||
# trigger on pull_request or push events | ||
on: | ||
pull_request: | ||
push: | ||
|
||
# pipeline to execute | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.17 | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
|
||
- name: test | ||
run: | | ||
go test -race -covermode=atomic -coverprofile=coverage.out ./... | ||
- name: coverage | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# name of the action | ||
name: validate | ||
|
||
# trigger on pull_request or push events | ||
on: | ||
pull_request: | ||
push: | ||
|
||
# pipeline to execute | ||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.17 | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
|
||
- name: validate | ||
run: | | ||
# Check that go mod tidy produces a zero diff; clean up any changes afterwards. | ||
go mod tidy && git diff --exit-code; code=$?; git checkout -- .; (exit $code) | ||
# Check that go vet ./... produces a zero diff; clean up any changes afterwards. | ||
go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) | ||
# Check that go fmt ./... produces a zero diff; clean up any changes afterwards. | ||
go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) | ||
# Check that go fix ./... produces a zero diff; clean up any changes afterwards. | ||
go fix ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) |
Oops, something went wrong.