Skip to content

Commit

Permalink
Split linting into new github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Jun 27, 2023
1 parent a6059e4 commit 98a6a62
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 13 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: go-lint
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
lint:
strategy:
matrix:
go: [ '1.20' ]
os: [ ubuntu-latest ]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}

- name: Check formatting
uses: Jerome1337/[email protected]
with:
gofmt-path: '.'
gofmt-flags: '-l -d'

- name: Goimports Check
uses: DarthBenro008/[email protected]
with:
root-path: './'
14 changes: 1 addition & 13 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
id: go
Expand All @@ -50,7 +50,6 @@ jobs:
uses: actions/checkout@v3

- run: npm ci --no-optional
- run: npm run prettier
# - run: npm test
- run: npm run build
env:
Expand All @@ -68,17 +67,6 @@ jobs:
- name: Generate swagger docs
run: swag init -g http/http.go -o swaggerdocs

- name: Check formatting
uses: Jerome1337/[email protected]
with:
gofmt-path: '.'
gofmt-flags: '-l -d'

- name: Goimports Check
uses: DarthBenro008/[email protected]
with:
root-path: './'

- name: Test
run: go test `go list ./... | grep -v swaggerdocs`

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/ui-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ui-lint

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ "18.5.0" ]

steps:
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Check out code
uses: actions/checkout@v3

- run: npm ci --no-optional
- run: npm run prettier

0 comments on commit 98a6a62

Please sign in to comment.