Skip to content

Commit

Permalink
chore: save
Browse files Browse the repository at this point in the history
  • Loading branch information
danteay committed Feb 26, 2024
1 parent b6d0b4d commit e49c6bc
Show file tree
Hide file tree
Showing 23 changed files with 338 additions and 404 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cleanup_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cleanup
run: |
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/main_cleanup_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Main Cleanup Cache

on:
push:
branches:
- main

jobs:
clean_cache:
name: Cleanup main cache
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="main"
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 }}
74 changes: 0 additions & 74 deletions .github/workflows/main_coverage.yml

This file was deleted.

42 changes: 10 additions & 32 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Config private packages
run: git config --global url.https://${{ secrets.ACCESS_TOKEN }}@github.com/Drafteame.insteadOf https://github.com/Drafteame

- name: Checkout
uses: actions/[email protected]

- name: Install dependencies
run: go mod download

- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: "${{ secrets.ACCESS_TOKEN }}"

- name: Test
run: |
set -euo pipefail
go test -json -v -race -cover -coverprofile=coverage.out ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: Convert out to xml
run: |
go install github.com/axw/gocov/gocov@latest
go install github.com/AlekSi/gocov-xml@latest
gocov convert coverage.out | gocov-xml > coverage.xml
go mod download
go install gotest.tools/gotestsum@latest
- name: Review coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
- name: Test
run: gotestsum --format pkgname-and-test-fails --raw-command -- go test -v -race -json -coverprofile=coverage.out ./...

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Config private packages
run: git config --global url.https://${{ secrets.ACCESS_TOKEN }}@github.com/Drafteame.insteadOf https://github.com/Drafteame
Expand All @@ -79,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: '${{ secrets.ACCESS_TOKEN }}'
fetch-depth: 0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: "Bump version"
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.ACCESS_TOKEN }}"
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- bump_version
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.ACCESS_TOKEN }}"
Expand All @@ -71,7 +71,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Config private packages
run: git config --global url.https://${{ secrets.ACCESS_TOKEN }}@github.com/Drafteame.insteadOf https://github.com/Drafteame
Expand Down
33 changes: 0 additions & 33 deletions .golangci.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .gotestfmt/downloads.gotpl

This file was deleted.

24 changes: 0 additions & 24 deletions .gotestfmt/package.gotpl

This file was deleted.

19 changes: 11 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/Bahjat/pre-commit-golang
rev: v1.0.3
hooks:
- id: go-vet

- repo: https://github.com/Drafteame/pre-commit-golang
rev: 0.7.0
rev: 0.10.1
hooks:
- id: go-mod-tidy
- id: goimports-reviser
args: [ "-excludes=bin,node_modules,tmp,.git" ]
- id: revive
args: [ "-config=revive.toml", "-formatter=friendly" ]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/commitizen-tools/commitizen
rev: v2.42.1
rev: v3.14.1
hooks:
- id: commitizen
stages: [commit-msg]

- repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-revive
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/Drafteame/cassandra-builder

go 1.18
go 1.20

require (
github.com/avast/retry-go/v4 v4.3.3
github.com/gocql/gocql v1.3.1
github.com/magefile/mage v1.14.0
github.com/avast/retry-go/v4 v4.5.1
github.com/gocql/gocql v1.6.0
github.com/magefile/mage v1.15.0
github.com/scylladb/gocqlx v1.5.0
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.4
)

require (
Expand Down
Loading

0 comments on commit e49c6bc

Please sign in to comment.