-
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.
* feat: add slog adapter * ci: upgrade pre commit hooks * fix: modify mod versions * chore: save * ci: modify pipelines * chore: modify go version * ci: remove go 1.20 from pipeline * ci: complete first iteration of tagging
- Loading branch information
Showing
37 changed files
with
889 additions
and
303 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,7 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,32 @@ | ||
name: Cleanup caches by a branch | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
cleanup: | ||
name: Cleanup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cleanup all caches for repo | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
REPO=${{ github.repository }} | ||
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" | ||
echo "Fetching list of cache key" | ||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | 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 }} |
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,62 @@ | ||
name: Tag adapters | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tag_adapter: | ||
if: "!startsWith(github.event.head_commit.message, 'bump:')" | ||
name: Tag adapter | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
adapter: | ||
- slog | ||
- zerolog | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: "${{ secrets.ACCESS_TOKEN }}" | ||
ref: "main" | ||
|
||
- name: Files modified | ||
id: check | ||
uses: tj-actions/[email protected] | ||
with: | ||
files: | | ||
./adapters/${{ matrix.adapter }}/** | ||
- name: Should skip | ||
if: steps.check.outputs.any_changed != 'true' | ||
run: exit 78 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install commitizen | ||
run: pip install -U commitizen | ||
|
||
- id: cz | ||
name: Create bump and changelog | ||
working-directory: adapters/${{ matrix.adapter }} | ||
run: | | ||
python -m pip install -U commitizen | ||
cz bump --changelog --yes | ||
export REV=`cz version --project` | ||
echo "version=$REV" >> $GITHUB_OUTPUT | ||
- name: Push changes | ||
uses: Woile/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.ACCESS_TOKEN }} | ||
tags: "true" | ||
branch: "main" | ||
|
||
- name: Print Version | ||
run: echo "Bumped to version ${{ steps.cz.outputs.version }}" |
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,60 @@ | ||
name: Tag Logger | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tag_adapter: | ||
if: "!startsWith(github.event.head_commit.message, 'bump:')" | ||
name: Tag logger | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: "${{ secrets.ACCESS_TOKEN }}" | ||
ref: "main" | ||
|
||
- name: Files modified | ||
id: check | ||
uses: tj-actions/[email protected] | ||
with: | ||
files: | | ||
./internal/** | ||
./*.go | ||
./go.mod | ||
./go.sum | ||
- name: Should skip | ||
if: steps.check.outputs.any_changed != 'true' | ||
run: exit 78 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install commitizen | ||
run: pip install -U commitizen | ||
|
||
- id: cz | ||
name: Create bump and changelog | ||
working-directory: ${{ matrix.module }} | ||
run: | | ||
python -m pip install -U commitizen | ||
cz bump --changelog --yes | ||
export REV=`cz version --project` | ||
echo "version=$REV" >> $GITHUB_OUTPUT | ||
- name: Push changes | ||
uses: Woile/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.ACCESS_TOKEN }} | ||
tags: "true" | ||
branch: "main" | ||
|
||
- name: Print Version | ||
run: echo "Bumped to version ${{ steps.cz.outputs.version }}" |
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,62 @@ | ||
name: Tag modules | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tag_adapter: | ||
if: "!startsWith(github.event.head_commit.message, 'bump:')" | ||
name: Tag modules | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
module: | ||
- fields | ||
- levels | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: "${{ secrets.ACCESS_TOKEN }}" | ||
ref: "main" | ||
|
||
- name: Files modified | ||
id: check | ||
uses: tj-actions/[email protected] | ||
with: | ||
files: | | ||
./${{ matrix.module }}/** | ||
- name: Should skip | ||
if: steps.check.outputs.any_changed != 'true' | ||
run: exit 78 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install commitizen | ||
run: pip install -U commitizen | ||
|
||
- id: cz | ||
name: Create bump and changelog | ||
working-directory: ${{ matrix.module }} | ||
run: | | ||
python -m pip install -U commitizen | ||
cz bump --changelog --yes | ||
export REV=`cz version --project` | ||
echo "version=$REV" >> $GITHUB_OUTPUT | ||
- name: Push changes | ||
uses: Woile/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.ACCESS_TOKEN }} | ||
tags: "true" | ||
branch: "main" | ||
|
||
- name: Print Version | ||
run: echo "Bumped to version ${{ steps.cz.outputs.version }}" |
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,35 @@ | ||
name: Test adapters | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
adapter: | ||
- slog | ||
- zerolog | ||
go-version: | ||
- 1.21.x | ||
- 1.22.x | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Golang with cache | ||
uses: magnetikonline/action-golang-cache@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Install dependencies | ||
working-directory: adapters/${{ matrix.adapter }} | ||
run: go mod download | ||
|
||
- name: Run tests | ||
working-directory: adapters/${{ matrix.adapter }} | ||
run: go test -v github.com/danteay/golog/adapters/${{ matrix.adapter }} |
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,30 @@ | ||
name: Test logger | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-version: | ||
- 1.21.x | ||
- 1.22.x | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Golang with cache | ||
uses: magnetikonline/action-golang-cache@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Install dependencies | ||
run: go mod download | ||
|
||
- name: Run tests | ||
run: go test -v ./... |
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,35 @@ | ||
name: Test modules | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
module: | ||
- fields | ||
- levels | ||
go-version: | ||
- 1.21.x | ||
- 1.22.x | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Golang with cache | ||
uses: magnetikonline/action-golang-cache@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Install dependencies | ||
working-directory: ${{ matrix.module }} | ||
run: go mod download | ||
|
||
- name: Run tests | ||
working-directory: ${{ matrix.module }} | ||
run: go test -v github.com/danteay/golog/${{ matrix.module }} |
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
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
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
Oops, something went wrong.