Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
morenod committed Jul 21, 2023
1 parent 3be6d40 commit dc5fee3
Show file tree
Hide file tree
Showing 29 changed files with 917 additions and 328 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''
---

# Bug Description

## **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.
25 changes: 25 additions & 0 deletions .github/workflows/builders.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# builders.yml
name: Install pip requirements
on:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:

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

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install pip
run: python -m pip install --upgrade pip

- name: Install requirements
run: find . -name 'requirements.txt' -exec pip install -r {} \;
57 changes: 57 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# pullrequest.yml
name: Pull Request Workflow
on:
push:
branches:
- main
pull_request_target:
branches:
- main

jobs:
linters:
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@v3
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

tests:
needs: linters
uses: ./.github/workflows/tests.yml
secrets: inherit
# report_results:
# needs: tests
# if: always()
# runs-on: ubuntu-latest
# steps:
#
# - name: Check out code
# uses: actions/checkout@v3
# with:
# fetch-depth: 1
# ref: ${{ github.event.pull_request.head.sha }}
# persist-credentials: false
#
# - name: Download test results
# uses: actions/download-artifact@v3
# if: always()
# with:
# name: test-results
#
# - name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
# if: always()
# with:
# files: |
# test*results.xml
15 changes: 15 additions & 0 deletions .github/workflows/release.yml_
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release Workflow
on:
push:
tags:
- "*" # triggers only if push new tag version
jobs:
release-build:
uses: ./.github/workflows/gorelease.yml

image-upload:
uses: ./.github/workflows/image-upload.yml
secrets: inherit

deploy-docs:
uses: ./.github/workflows/docs.yml
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
76 changes: 76 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# tests.yml
name: Execute tests
on:
workflow_call:
secrets:
ROSA_BURNER_OCM_TOKEN:
required: true
AWS_ACCESS_KEY:
required: true
AWS_SECRET_KEY:
required: true
jobs:
test-rosa:
runs-on: ubuntu-latest
strategy:
matrix:
subplatform:
- hypershift
steps:

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

- name: Download tools
run: bash utils/download_tools.sh

- name: Create AWS Config File
run: |
echo "[default]" > /tmp/aws_config.ini
echo "aws_access_key_id=${{ secrets.AWS_ACCESS_KEY }}" >> /tmp/aws_config.ini
echo "aws_secret_access_key=${{ secrets.AWS_SECRET_KEY }}" >> /tmp/aws_config.ini
- name: Install pip
run: python -m pip install --upgrade pip

- name: Install requirements
run: find . -name 'requirements.txt' -exec pip install -r {} \;

- name: Execute tests
run: python rosa-burner.py --config-file ./rosa-burner.ini --platform rosa --subplatform ${{matrix.subplatform}}
env:
ROSA_BURNER_OCM_TOKEN: ${{ secrets.ROSA_BURNER_OCM_TOKEN }}
ROSA_BURNER_AWS_ACCOUNT_FILE: "/tmp/aws_config.ini"

# - name: Install bats
# uses: mig4/setup-bats@v1
# with:
# bats-version: 1.9.0
#
# - name: Execute Tests
# working-directory: test
# run: |
# export PATH=${PATH}:/tmp/
# chmod +x /tmp/kube-burner
# bats -F pretty -T --report-formatter junit --print-output-on-failure test-k8s.bats
# env:
# TERM: linux
# KIND_VERSION: v0.19.0
# K8S_VERSION: ${{matrix.k8s-version}}
#
# - name: Upload test results artifact
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: test-k8s-results
# path: test/report.xml
#
# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v3
# if: always()
# with:
# report_paths: test/report.xml
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ repos:
hooks:
- id: flake8
args:
- --max-line-length=300
- --max-line-length=400
- repo: https://github.com/PyCQA/pylint
rev: v3.0.0a6
hooks:
- id: pylint
args:
- --max-line-length=300
- --max-line-length=400
- --errors-only
- --disable=C,R,E0401
Loading

0 comments on commit dc5fee3

Please sign in to comment.