Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Jan 4, 2024
1 parent c9de764 commit 0b80026
Show file tree
Hide file tree
Showing 71 changed files with 2,449 additions and 598 deletions.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''
---

# Bug Description

## **Output of `kube-burner` version**

## **Describe the bug**

A clear and concise description of what the bug is.

## **To Reproduce**

Steps to reproduce the behavior:

1. Go to '...'
1. Click on '....'
1. Scroll down to '....'
1. See error

## **Expected behavior**

A clear and concise description of what you expected to happen.

## **Screenshots or output**

If applicable, add screenshots or kube-burner output to help explain your problem.

## **Additional context**

Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[RFE]'
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Type of change

- [ ] Refactor
- [ ] New feature
- [ ] Bug fix
- [ ] Optimization
- [ ] Documentation Update

## Description

<!--- Describe your changes in detail -->

## Related Tickets & Documents

- Related Issue #
- Closes #

## Checklist before requesting a review

- [ ] I have performed a self-review of my code.
- [ ] If it is a core feature, I have added thorough tests.
35 changes: 35 additions & 0 deletions .github/workflows/builders.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build kube-burner-ocp
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: Build code
run: make build

- name: Install mkdocs dependencies
run: pip install mkdocs-material mkdocs-include-markdown-plugin mike

- name: Build documentation
run: mkdocs build

- name: Install
run: sudo make install

- uses: actions/upload-artifact@v3
with:
name: kube-burner-ocp
path: /usr/bin/kube-burner-ocp
19 changes: 19 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI tests
on:
workflow_call:
pull_request_target:
branches:
- master
- main

jobs:
lint:
uses: ./.github/workflows/linters.yml

build:
uses: ./.github/workflows/builders.yml

tests:
needs: build
uses: ./.github/workflows/test-ocp.yml
secrets: inherit
46 changes: 46 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy docs
on:
workflow_call:
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Setup doc deploy
run: |
git config --global user.name Docs deploy
git config --global user.email [email protected]
- name: Install dependencies
run: pip install mkdocs-material mkdocs-include-markdown-plugin mike

- name: Deploy docs
run: mike deploy --push -m "Update docs to version ${{ github.ref_name }}" --update-aliases ${{ github.ref_name }} latest

- name: Delete docs for older tags
run: |
echo "Keeping documentation for latest tags"
all_tags=$(git tag --sort=-v:refname)
tags_to_keep=$(echo "$all_tags" | head -n 3)
for tag in $all_tags; do
if [[ $tags_to_keep != *"$tag"* ]]; then
if mike list | grep -q "$tag"; then
echo "Deleting documentation for tag: $tag"
mike delete "$tag"
else
echo "Documentation for tag $tag not found. Skipping deletion."
fi
fi
done
- name: Set latest as default doc branch
run: mike set-default --push latest
27 changes: 27 additions & 0 deletions .github/workflows/gorelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# gorelease.yml
name: Create a new release of project
on:
workflow_call:
jobs:
release-go:
name: GoReleaser build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/
persist-credentials: false

- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@master
with:
version: 1.19.0
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Linters
on:
workflow_call:
jobs:
linters:
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit hooks
run: pre-commit run --all-files
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release Workflow
on:
push:
tags:
- "*" # triggers only if push new tag version
jobs:
ci-tests:
uses: ./.github/workflows/ci-tests.yml
secrets: inherit

release-build:
uses: ./.github/workflows/gorelease.yml
needs: ci-tests

deploy-docs:
uses: ./.github/workflows/docs.yml
needs: ci-tests
22 changes: 22 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 12 * * *"

jobs:
stale:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v8
with:
stale-issue-message: 'This issue has become stale and will be closed automatically within 7 days.'
stale-pr-message: 'This pull request has become stale and will be closed automatically within 7 days.'
stale-issue-label: 'stale'
stale-pr-label: 'stale'
days-before-stale: 90
days-before-close: 7
55 changes: 55 additions & 0 deletions .github/workflows/test-ocp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Execute tests on OCP
on:
workflow_call:
secrets:
OPENSHIFT_SERVER:
required: true
OPENSHIFT_USER:
required: true
OPENSHIFT_PASSWORD:
required: true
jobs:
ocp-e2e-ci:
runs-on: ubuntu-latest
concurrency:
group: ocp-e2e-ci
steps:

- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Download kube-burner-ocp binary
uses: actions/download-artifact@v3
with:
name: kube-burner-ocp
path: /tmp/

- name: Install bats
uses: mig4/setup-bats@v1
with:
bats-version: 1.9.0

- name: Install oc
uses: redhat-actions/oc-installer@v1

- name: Authenticate against OCP cluster
run: oc login -u ${OPENSHIFT_USER} -p ${OPENSHIFT_PASSWORD} ${OPENSHIFT_SERVER} --insecure-skip-tls-verify=true
env:
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
OPENSHIFT_USER: ${{ secrets.OPENSHIFT_USER }}
OPENSHIFT_PASSWORD: ${{ secrets.OPENSHIFT_PASSWORD }}

- name: Execute Tests
run: |
export PATH=${PATH}:/tmp/
chmod +x /tmp/kube-burner-ocp
make test-ocp
env:
TERM: linux
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
OPENSHIFT_USER: ${{ secrets.OPENSHIFT_USER }}
OPENSHIFT_PASSWORD: ${{ secrets.OPENSHIFT_PASSWORD }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out
bin
dist
site/
23 changes: 23 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
run:
timeout: 5m
linters-settings:
misspell:
locale: US
linters:
disable-all: true
enable:
- nakedret
- unused
- misspell
- ineffassign
- goconst
- goimports
- dupl
- unparam
- revive
- staticcheck
- gosimple
- unconvert
- gocyclo
- gofmt
- govet
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.51.2
hooks:
- id: golangci-lint
args: [--timeout=5m]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.34.0
hooks:
- id: markdownlint
args: [--disable, MD013, MD002]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-json
Loading

0 comments on commit 0b80026

Please sign in to comment.