Skip to content

Commit

Permalink
Merge branch 'master' into dwisiswant0/refactor/mod-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisiswant0 committed Jun 11, 2024
2 parents 788bf85 + f1af8c8 commit 1e72549
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 132 deletions.
55 changes: 4 additions & 51 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Auto Merge PR

on:
pull_request:
types: [labeled, unlabeled]
types: [labeled, unlabeled, opened, reopened]
pull_request_review:
types: [submitted]
workflow_call:
Expand All @@ -15,53 +15,6 @@ jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: Is PR ready?
id: is-ready
if: >
(
(
!github.event.pull_request.draft &&
github.event.pull_request.mergeable
) ||
contains(github.event.pull_request.labels.*.name, 'ready')
)
run: true

- name: Is Dependabot?
id: is-dependabot
if: github.event.pull_request.user.login == 'dependabot[bot]'
run: true

- name: Is patch update?
id: patch-update
if: >
steps.is-dependabot.outcome == 'success' && contains(
github.event.head_commit.message, 'version-update:semver-patch'
)
run: true

- name: Auto merge PR
if: >
(
steps.is-ready.outcome == 'success' ||
steps.is-dependabot.outcome == 'success'
)
uses: pascalgn/automerge-action@v0.16.3
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: ""
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "automatic"
MERGE_FILTER_AUTHOR: "dependabot[bot]"
MERGE_FORKS: "true"
MERGE_RETRIES: "6"
MERGE_RETRY_SLEEP: "10000"
MERGE_REQUIRED_APPROVALS: "${{
(
steps.is-ready.outcome == 'success' ||
steps.patch-update.outcome == 'success'
) &&
0 || 1
}}"
UPDATE_LABELS: ""
UPDATE_METHOD: "rebase"
- uses: teler-sh/actions/auto-merge@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
32 changes: 0 additions & 32 deletions .github/workflows/codeql.yaml

This file was deleted.

92 changes: 43 additions & 49 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: "Tests"

on:
push:
branches:
Expand All @@ -10,69 +8,65 @@ on:
pull_request:
branches:
- "**"
paths:
- "**.go"
- "go.mod"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: read
contents: read
pull-requests: write
security-events: write

name: tests
jobs:
tests:
strategy:
matrix:
go-version: [1.20.x, 1.21.x, 1.22.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: teler-sh/actions/setup-go@v1
with:
go-version-file: 'go.mod'
cache-dependency-path: '**/go.sum'
- name: Vetting
run: make vet
- name: Build
run: make build
- name: Clean up
run: make clean
go-version: '${{ matrix.go-version }}'
- uses: teler-sh/actions/resources@v1
- run: make ci
if: (github.event_name != 'workflow_dispatch')

sast:
runs-on: ubuntu-latest
needs: tests
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: teler-sh/actions/dependency-review@v1
if: (github.event_name == 'push')
- uses: teler-sh/actions/golangci-lint@v1
- uses: teler-sh/actions/semgrep@v1
- uses: teler-sh/actions/codeql@v1
with:
lang: go

codecov:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache-dependency-path: '**/go.sum'
- uses: teler-sh/actions/setup-go@v1
- uses: teler-sh/actions/resources@v1
- run: make cover
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/teler-coverage.out

golangci:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
args: --timeout=5m --tests=false

semgrep:
runs-on: ubuntu-latest
needs: tests
container:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v3
- run: semgrep ci
env:
SEMGREP_RULES: auto

codeql:
needs: tests
uses: ./.github/workflows/codeql.yaml

auto-merge:
if: (github.event_name == 'pull_request')
uses: ./.github/workflows/auto-merge.yaml
file: /tmp/teler-coverage.out
verbose: true
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ clean:

teler-proxy: build

ci: vet build clean

all: test report build

0 comments on commit 1e72549

Please sign in to comment.