forked from konflux-ci/qe-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'redhat-appstudio:main' into main
- Loading branch information
Showing
34 changed files
with
1,943 additions
and
356 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,4 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
ignores: [(message) => /^feat(deps): bump \[.+]\(.+\) from .+ to .+\.$/m.test(message)], | ||
} |
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 |
---|---|---|
|
@@ -3,34 +3,48 @@ name: Coffee-break | |
on: | ||
schedule: | ||
- cron: '0 0 5 * *' # This runs at 00:00 UTC on the 5th of every month | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
coffee-break: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: golang:1.19 | ||
container: | ||
image: quay.io/redhat-appstudio-qe/qe-tools:latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'redhat-appstudio/qe-tools' | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'redhat-appstudio/qe-tools' | ||
- name: Setup Go environment | ||
uses: actions/setup-go@v5 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v4 | ||
- name: Run Test and Send Slack Message | ||
run: qe-tools coffee-break | ||
env: | ||
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | ||
HACBS_CHANNEL_ID: ${{ secrets.HACBS_CHANNEL_ID }} | ||
|
||
- name: Run Test and Send Slack Message | ||
run: go run main.go coffee-break | ||
env: | ||
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | ||
HACBS_CHANNEL_ID: ${{ secrets.HACBS_CHANNEL_ID }} | ||
- name: Commit and push | ||
run: | | ||
git config user.name "GitHub Action" | ||
git config user.email "[email protected]" | ||
git switch -c coffee-break | ||
git add config/coffee-break/last_week.txt | ||
git commit -m "chore: update config/coffee-break/last_week.txt" | ||
git push -u origin HEAD | ||
- name: Commit and push if it's not a Pull Request | ||
run: | | ||
git config --global --add safe.directory /__w/qe-tools/qe-tools | ||
git init /__w/qe-tools/qe-tools | ||
git config user.name "GitHub Action" | ||
git config user.email "[email protected]" | ||
git add config/coffee-break/last_week.txt | ||
git commit -m "Update config/coffee-break/last_week.txt" | ||
git push origin main -f | ||
create-pr: | ||
runs-on: ubuntu-latest | ||
needs: coffee-break | ||
steps: | ||
- name: Create PR | ||
run: | | ||
gh pr create \ | ||
-t "chore: Add last Coffee Break" \ | ||
-b "Created automatically by a GitHub Action." \ | ||
-H coffee-break \ | ||
-B main \ | ||
-R ${{ github.repository }} \ | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
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
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: Estimate-review | ||
|
||
on: pull_request_target | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
estimate: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'redhat-appstudio/qe-tools' | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v5 | ||
|
||
- name: Build qe-tools | ||
run: make build | ||
|
||
- name: Run estimate time needed for PR review | ||
run: | | ||
./qe-tools estimate-review \ | ||
--owner ${{ github.repository_owner }} \ | ||
--repository ${{ github.event.repository.name }} \ | ||
--number ${{ github.event.pull_request.number }} \ | ||
--config ${{ env.CONFIG_PATH }} \ | ||
--token ${{ github.token }} \ | ||
--add-label \ | ||
--human | ||
env: | ||
CONFIG_PATH: 'config/estimate/config.yaml' |
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
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,24 @@ | ||
name: Pre-commit checks | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@v5 | ||
|
||
- name: Install required tools | ||
run: | | ||
pip install pre-commit | ||
make bootstrap | ||
go mod tidy | ||
- name: Run pre-commit checks | ||
run: make pre-commit |
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,23 @@ | ||
name: release | ||
|
||
on: | ||
release: | ||
types: [ created ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: wangyoucao577/go-release-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: linux | ||
goarch: amd64 | ||
goversion: "1.20" | ||
binary_name: qe-tools | ||
extra_files: config |
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
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
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
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,5 @@ | ||
# Path to sources | ||
sonar.sources=. | ||
sonar.exclusions=**/*test*, **/vendor/**, **/zz_generated.*, | ||
# Source encoding | ||
sonar.sourceEncoding=UTF-8 |
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,25 @@ | ||
FROM registry.access.redhat.com/ubi9/go-toolset:1.20.10 AS builder | ||
|
||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
|
||
RUN go mod download | ||
|
||
COPY main.go main.go | ||
COPY config/ config/ | ||
COPY tools/ tools/ | ||
COPY pkg/ pkg/ | ||
COPY cmd/ cmd/ | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o qe-tools main.go | ||
|
||
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.3 | ||
|
||
USER 65532:65532 | ||
|
||
WORKDIR /qe-tools | ||
|
||
COPY --from=builder /opt/app-root/src/qe-tools /usr/bin/ | ||
COPY --from=builder /opt/app-root/src/config config | ||
|
||
|
Oops, something went wrong.