Skip to content

Commit

Permalink
Merge pull request #1 from hoanguyenkh/hoa/add-git-workflow
Browse files Browse the repository at this point in the history
feat: add github workflows
  • Loading branch information
hoanguyenkh authored Sep 21, 2024
2 parents 6a39cee + 864cbb2 commit d9eff6a
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
27 changes: 27 additions & 0 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.23.1"
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout 10m
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.1"

- name: Test
run: go test --race -v ./...
4 changes: 3 additions & 1 deletion pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func FromConcPool(p *conc.Pool) Pool {

func FromAntsPool(p *ants.Pool) Pool {
return wrapFunc(func(f func()) {
p.Submit(f)
if err := p.Submit(f); err != nil {
panic(err)
}
})
}

0 comments on commit d9eff6a

Please sign in to comment.