From 98a6a62d62827cac3d912418d69dd76f89316897 Mon Sep 17 00:00:00 2001 From: Steven Weathers Date: Tue, 27 Jun 2023 00:19:34 -0400 Subject: [PATCH] Split linting into new github actions --- .github/workflows/go-lint.yml | 36 +++++++++++++++++++++++++++++++++++ .github/workflows/go.yml | 14 +------------- .github/workflows/ui-lint.yml | 28 +++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/go-lint.yml create mode 100644 .github/workflows/ui-lint.yml diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml new file mode 100644 index 00000000..4a049810 --- /dev/null +++ b/.github/workflows/go-lint.yml @@ -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/gofmt-action@v1.0.5 + with: + gofmt-path: '.' + gofmt-flags: '-l -d' + + - name: Goimports Check + uses: DarthBenro008/goimports-check-action@v0.1.0 + with: + root-path: './' \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 107ee852..790d85a8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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 @@ -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: @@ -68,17 +67,6 @@ jobs: - name: Generate swagger docs run: swag init -g http/http.go -o swaggerdocs - - name: Check formatting - uses: Jerome1337/gofmt-action@v1.0.5 - with: - gofmt-path: '.' - gofmt-flags: '-l -d' - - - name: Goimports Check - uses: DarthBenro008/goimports-check-action@v0.1.0 - with: - root-path: './' - - name: Test run: go test `go list ./... | grep -v swaggerdocs` diff --git a/.github/workflows/ui-lint.yml b/.github/workflows/ui-lint.yml new file mode 100644 index 00000000..2c460ccc --- /dev/null +++ b/.github/workflows/ui-lint.yml @@ -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 \ No newline at end of file