From af2d49925a99cbd8039b15968033cc3a3525a29d Mon Sep 17 00:00:00 2001 From: bdular Date: Wed, 31 Jul 2024 22:28:19 +0200 Subject: [PATCH] Updated test workflow and added lint workflow --- .github/workflows/lint.yaml | 39 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yaml | 28 ++++++++++++-------------- 2 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..3bc0202 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,39 @@ +name: Lint +on: + push: + branches: + - main + paths-ignore: + - '.run/**' + - '.vscode/**' + - 'documentation/**' + + pull_request: + types: [ opened, synchronize ] + paths-ignore: + - '.run/**' + - '.vscode/**' + - 'documentation/**' + branches: + - main + + workflow_dispatch: + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: 1.20 + + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.59 + args: --timeout=3m \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0255af1..5e3feaf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,35 +1,31 @@ -name: "Testing" - +name: "Tests" on: - push: + pull_request: + types: [ opened, synchronize ] branches: - main paths-ignore: - - 'docs/**' + - '.run/**' + - '.vscode/**' - 'documentation/**' - '*.md' - - 'docker-compose.yaml' - - 'docker-compose.dev.yaml' - - 'makefile' - pull_request: - types: [ opened,synchronize ] - branches: - - main + workflow_dispatch: jobs: - test: - name: Run Go Unit Tests + # Run unit tests + tests: + name: "Run unit tests" runs-on: ubuntu-latest steps: - - name: Check out code into the Go module directory + - name: Checkout uses: actions/checkout@v4 - - name: Set up Go + - name: Setup Go uses: actions/setup-go@v5 with: go-version: 1.20 - - name: Get dependencies and run tests + - name: Install dependencies and run tests run: | go mod download go test -v ./... \ No newline at end of file