Skip to content

Commit

Permalink
Merge branch 'main' into renovate/uvicorn-0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
pigri authored Nov 6, 2024
2 parents f383422 + 021d6e6 commit f845585
Show file tree
Hide file tree
Showing 26 changed files with 857 additions and 476 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

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

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**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: ''
labels: ''
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.
Original file line number Diff line number Diff line change
@@ -1,46 +1,69 @@
name: Cache service preview
name: cache-preview

on:
pull_request_review:
types: [submitted]
pull_request:
types: [opened, synchronize]
branches:
- main
paths:
- services/cache/**
- .github/workflows/cache-pull.yaml
- .github/workflows/cache-preview.yaml
pull_request_review:
types: [submitted]
issue_comment:
types: [created]

jobs:
image-build:
runs-on: ubicloud-standard-2
if: github.event.review.state == 'approved'
if: |
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, 'test') &&
github.event.issue.pull_request != null &&
github.event.pull_request.changed_files > 0) ||
(github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved' &&
github.event.pull_request.changed_files > 0)
steps:
- name: Check for path changes
id: path-check
run: |
echo "Checking for changes in specified paths..."
git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E 'services/cache/|.github/workflows/cache-pull.yaml' || echo "no-changes"
- name: Login to Github Packages
if: steps.path-check.outputs.result != 'no-changes'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
if: steps.path-check.outputs.result != 'no-changes'
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all

- name: 🏗 Setup repo
if: steps.path-check.outputs.result != 'no-changes'
uses: actions/checkout@v4

- name: Set up Docker Context for Buildx
if: steps.path-check.outputs.result != 'no-changes'
run: docker context create builders

- name: Set up Docker Buildx
if: steps.path-check.outputs.result != 'no-changes'
uses: docker/setup-buildx-action@v3
with:
version: latest
endpoint: builders

- name: Docker meta
if: steps.path-check.outputs.result != 'no-changes'
id: cache
uses: docker/metadata-action@v5
with:
Expand All @@ -51,10 +74,11 @@ jobs:
type=raw,value=latest
- name: Build
if: steps.path-check.outputs.result != 'no-changes'
uses: docker/build-push-action@v6
with:
context: services/cache
platforms: linux/arm64,linux/amd64
push: false
tags: ${{ steps.cache.outputs.tags }}
labels: ${{ steps.cache.outputs.labels }}
labels: ${{ steps.cache.outputs.labels }}
128 changes: 128 additions & 0 deletions .github/workflows/core-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: core-preview

on:
pull_request:
types: [opened, synchronize]
branches:
- main
paths:
- '*.go'
- 'go.mod'
- 'go.sum'
- .github/workflows/core-preview.yaml
pull_request_review:
types: [submitted]
issue_comment:
types: [created]

jobs:
core-unit-test:
if: |
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, 'test') &&
github.event.issue.pull_request != null &&
github.event.pull_request.changed_files > 0) ||
(github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved' &&
github.event.pull_request.changed_files > 0)
name: Core unit tests
runs-on: ubicloud-standard-2
strategy:
matrix:
go-version: [ '1.21', '1.22', '1.23' ]
steps:
- name: Check for path changes
id: path-check
run: |
echo "Checking for changes in specified paths..."
git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '\.go$|go\.mod|go\.sum|\.github/workflows/core-pull\.yaml' || echo "no-changes"
- uses: actions/checkout@v4
if: steps.path-check.outputs.result != 'no-changes'

- name: Copy and rename config file
if: steps.path-check.outputs.result != 'no-changes'
run: cp config_example.yaml config.yaml

- name: Setup Go ${{ matrix.go-version }}
if: steps.path-check.outputs.result != 'no-changes'
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Install dependencies
if: steps.path-check.outputs.result != 'no-changes'
run: go get -v

- name: Run unit tests
if: steps.path-check.outputs.result != 'no-changes'
run: ENV=test go test ./...

core-docker-build:
if: |
(github.event_name == 'issue_comment' &&
contains(github.event.comment.body, 'test') &&
github.event.issue.pull_request != null &&
github.event.pull_request.changed_files > 0) ||
(github.event_name == 'pull_request_review' &&
github.event.review.state == 'approved' &&
github.event.pull_request.changed_files > 0)
runs-on: ubicloud-standard-2
steps:
- name: Check for path changes
id: path-check
run: |
echo "Checking for changes in specified paths..."
git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '\.go$|go\.mod|go\.sum|\.github/workflows/core-pull\.yaml' || echo "no-changes"
- name: Login to Github Packages
if: steps.path-check.outputs.result != 'no-changes'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
if: steps.path-check.outputs.result != 'no-changes'
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all

- name: 🏗 Setup repo
if: steps.path-check.outputs.result != 'no-changes'
uses: actions/checkout@v4

- name: Set up Docker Context for Buildx
if: steps.path-check.outputs.result != 'no-changes'
run: docker context create builders

- name: Set up Docker Buildx
if: steps.path-check.outputs.result != 'no-changes'
uses: docker/setup-buildx-action@v3
with:
version: latest
endpoint: builders

- name: Docker meta
if: steps.path-check.outputs.result != 'no-changes'
id: openshield
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/openshieldai/openshield/openshield
tags: |
type=sha
type=raw,value=latest
- name: Build
if: steps.path-check.outputs.result != 'no-changes'
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64,linux/amd64
push: false
tags: ${{ steps.openshield.outputs.tags }}
labels: ${{ steps.openshield.outputs.labels }}
87 changes: 0 additions & 87 deletions .github/workflows/core-pull.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/discord-notifications.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
release:
types: [published]

jobs:
github-releases-to-discord:
name: Github Releases To Discord
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Github Releases To Discord
uses: SethCohen/[email protected]
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
color: "2105893"
username: "Release Changelog"
avatar_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png"
content: "||@everyone||"
footer_title: "Changelog"
footer_icon_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png"
footer_timestamp: true
Loading

0 comments on commit f845585

Please sign in to comment.