-
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.
- Loading branch information
1 parent
a074c34
commit 809fb70
Showing
6 changed files
with
145 additions
and
0 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,21 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "monday" | ||
time: "09:00" | ||
open-pull-requests-limit: 10 | ||
commit-message: | ||
prefix: "chore(deps): " | ||
reviewers: | ||
- "zakir-code" | ||
assignees: | ||
- "zakir-code" |
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,29 @@ | ||
name: cleanup caches by a branch | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
cleanup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cleanup | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
echo "Fetching list of cache key" | ||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) | ||
## Setting this to not fail the workflow while deleting cache keys. | ||
set +e | ||
echo "Deleting caches..." | ||
for cacheKey in $cacheKeysForPR | ||
do | ||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | ||
done | ||
echo "Done" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO: ${{ github.repository }} | ||
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge |
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,40 @@ | ||
name: Lint Golang | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- '.golangci.yml' | ||
- '.github/workflows/golang.yml' | ||
pull_request: | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- '.golangci.yml' | ||
- '.github/workflows/golang.yml' | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
- name: Install golangci-lint | ||
run: | | ||
version=$(grep golangci_version= ./Makefile | awk -F '=' '{print $2}') | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin $version | ||
- name: Make build and lint | ||
run: make lint |
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,18 @@ | ||
name: Publish Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create Release | ||
run: gh release create ${GITHUB_REF#refs/tags/} --title ${GITHUB_REF#refs/tags/} --generate-notes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- '*/go.mod' | ||
pull_request: | ||
paths: | ||
- '**.go' | ||
- 'go.mod' | ||
- '*/go.mod' | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: Run make test | ||
run: make test |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
# go-sdk | ||
|
||
[![Lint](https://github.com/pundiai/go-sdk/actions/workflows/golang.yml/badge.svg)](https://github.com/pundiai/go-sdk/actions/workflows/golang.yml) | ||
[![Test](https://github.com/pundiai/go-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/pundiai/go-sdk/actions/workflows/test.yml) |