Skip to content

Commit

Permalink
build: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisuhag committed Oct 31, 2024
1 parent 7b95313 commit 44edda4
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 140 deletions.
38 changes: 0 additions & 38 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

13 changes: 13 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Raystack takes the security of our software products and services seriously.

If you believe you have found a security vulnerability in this project, you can report it to us directly using [private vulnerability reporting][].

- Include a description of your investigation of the this project's codebase and why you believe an exploit is possible.
- POCs and links to code are greatly encouraged.
- Such reports are not eligible for a bounty reward.

**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**

Thanks for helping make GitHub safe for everyone.

[private vulnerability reporting]: https://github.com/raystack/meteor/security/advisories
18 changes: 2 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ jobs:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "stable"
cache: true
go-version-file: "go.mod"
- name: Get release tag
id: get_version
uses: battila7/get-version-action@v2
Expand All @@ -29,16 +28,3 @@ jobs:
distribution: goreleaser
version: ~v2
args: --snapshot --clean
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Images
run: docker push docker.io/raystack/meteor:latest
23 changes: 0 additions & 23 deletions .github/workflows/build_dev.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: docs

name: Docs
on:
push:
branches:
Expand All @@ -11,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v2
- name: Installation
uses: bahmutov/npm-install@v1
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
name: lint

name: Lint
on:
push:
branches:
- main
paths:
- "**.go"
- go.mod
- go.sum
pull_request:
paths:
- "**.go"
- go.mod
- go.sum

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run linter
uses: golangci/golangci-lint-action@v3
go-version-file: "go.mod"

- name: Run checks
uses: golangci/golangci-lint-action@v6
with:
version: v1.53
version: v1.60
args: --timeout=5m
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: release

name: Release
on:
push:
tags:
Expand All @@ -18,8 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "stable"
cache: true
go-version-file: "go.mod"
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand Down
34 changes: 15 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Test

on:
push:
pull_request:
Expand All @@ -10,18 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.20'
cache: true
go-version-file: "go.mod"
- name: Install dependencies
run: sudo apt-get install build-essential
- name: Run Test
run: make test
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.out
Expand All @@ -32,12 +30,12 @@ jobs:
plugins: ${{ steps.set-matrix.outputs.plugins }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- id: set-matrix
run: |
echo "plugins=$(find plugins -mindepth 2 -maxdepth 2 -type d | sed 's/plugins\///' | awk 'BEGIN{printf "["} {printf "%s\"%s\"",sep,$0; sep=","} END{print ",\".\"]"}')" >> $GITHUB_OUTPUT
plugins-test:
plugins:
needs: pretest
runs-on: ubuntu-latest
if: |
Expand All @@ -49,33 +47,31 @@ jobs:
plugins: ${{ fromJson(needs.pretest.outputs.plugins) }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.20'
cache: true
go-version-file: "go.mod"
- name: Install dependencies
run: sudo apt-get install build-essential
- name: Run Test
run: make test-plugins PLUGIN=${{ matrix.plugins }}
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-plugins
path: coverage-plugins*.out

coverage:
runs-on: ubuntu-latest
needs: [test, plugins-test]
needs: [test, plugins]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.20'
cache: true
go-version-file: "go.mod"
- name: Download coverage
uses: actions/download-artifact@v3
with:
Expand All @@ -89,4 +85,4 @@ jobs:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go install github.com/mattn/goveralls@v0.0.11
goveralls -coverprofile=$(ls -1 coverage*.out | paste -sd "," -) -service=github
goveralls -coverprofile=$(ls -1 coverage*.out | paste -sd "," -) -service=github
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ test-plugins:
@echo " > Testing plugins with tag 'plugins'"
go test $(if $(filter .,$(PLUGIN)),./plugins,$(if $(PLUGIN),./plugins/$(PLUGIN)/...,./plugins/...)) -tags=plugins -coverprofile=coverage-plugins$(subst .,root,$(subst /,-,$(if $(PLUGIN),-$(PLUGIN),))).out -parallel=1

test-coverage: # test test-plugins
test-coverage:
cp coverage.out coverage-all.out
tail -n +2 coverage-plugins.out >> coverage-all.out
go tool cover -html=coverage-all.out

generate-proto: ## regenerate protos
generate-proto:
@echo " > cloning protobuf from raystack/proton"
@echo " > generating protobuf"
@buf generate --template buf.gen.yaml https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --path raystack/assets/v1beta2
@echo " > protobuf compilation finished"

lint: ## Lint with golangci-lint
lint:
golangci-lint run

install: ## install required dependencies
install:
@echo "> installing dependencies"
go install github.com/vektra/mockery/v2@v2.14.0

0 comments on commit 44edda4

Please sign in to comment.