Skip to content

Commit

Permalink
- optimization suggestion for #372
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixCrawler committed Apr 9, 2024
1 parent fe07d8b commit 1b2dc44
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ updates:
labels:
- c:deps
- golang
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "07:00"
40 changes: 32 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@ env:
CGO_ENABLED: 0 # Build statically linked binaries

jobs:
fmt_and_vet:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Check vet
run: |
go vet ./...
- name: Check fmt
run: |
go fmt ./...
if [[ -z "$(git status --porcelain)" ]]; then
echo "Formatting is consistent with 'go fmt'."
else
echo "Run 'go fmt ./...' to automatically apply standard Go style to all packages."
git status --porcelain
exit 1
fi
integration_tests_linux:
strategy:
matrix:
Expand All @@ -31,12 +57,13 @@ jobs:
- name: Build code
run: go build -v ./...

- name: Running test
- name: Running unit tests
run: |
set -e
go get -v -t -d ./...
go vet -tests=false ./...
go test -v ./...
- name: Running integration tests
run: |
set -e
mkdir -p build
go build -v -o build/tfswitch
mkdir `pwd`/bin/
Expand All @@ -60,9 +87,6 @@ jobs:
with:
go-version: ${{ matrix.go_version }}

- name: Build code
run: go build -v ./...

- name: Running test
- name: Running unit tests
run: |
go test -v ./...

0 comments on commit 1b2dc44

Please sign in to comment.