From 33483bdb67d7610489e1beff37ba78767729cf0e Mon Sep 17 00:00:00 2001 From: Pulkit Kathuria Date: Mon, 25 Nov 2024 23:15:34 +0900 Subject: [PATCH] ci: inflation is high --- .github/workflows/coveritup.yml | 112 -------------------------------- .github/workflows/tests.yml | 50 ++++++++++++++ README.md | 19 ------ 3 files changed, 50 insertions(+), 131 deletions(-) delete mode 100644 .github/workflows/coveritup.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/coveritup.yml b/.github/workflows/coveritup.yml deleted file mode 100644 index 09c7824..0000000 --- a/.github/workflows/coveritup.yml +++ /dev/null @@ -1,112 +0,0 @@ -on: - pull_request: - push: - tags-ignore: - - '**' - branches: - - '**' - -name: "Cover It Up v2" -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} -jobs: - coveritup: - strategy: - matrix: - go-version: [latest] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: kevincobain2000/action-gobrew@v2 - with: - version: ${{ matrix.go-version }} - - name: Setup Node.js ${{ matrix.node-versions }} - uses: actions/setup-node@v2 - with: - node-version: 20 - - - name: Install Tools - run: | - go install github.com/axw/gocov/gocov@latest - go install github.com/AlekSi/gocov-xml@latest - go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh - - name: Setup Node.js ${{ matrix.node-versions }} - uses: actions/setup-node@v2 - with: - node-version: 20 - - uses: shogo82148/actions-setup-mysql@v1 - with: - mysql-version: "8.0" - - - name: NPM Install - uses: kevincobain2000/action-coveritup@v2 - with: - type: npm-install-time - command: cd frontend; npm install - record: runtime - - - name: Astro Check - run: cd frontend; npm run check - - - name: NPM Build - uses: kevincobain2000/action-coveritup@v2 - with: - type: npm-build-time - command: cd frontend; npm run build - record: runtime - - - name: Go Build CLI - uses: kevincobain2000/action-coveritup@v2 - with: - type: go-build-cli-time - command: go mod tidy;go build -ldflags '-s -w' -o gol frontend/main.go - record: runtime - - - name: Go Build All - uses: kevincobain2000/action-coveritup@v2 - with: - type: go-build-all-time - command: go mod tidy;go build - record: runtime - - - name: Lint Errors - run: golangci-lint run ./... - - - name: Test - uses: kevincobain2000/action-coveritup@v2 - with: - type: go-test-run-time - command: go test -race -v ./... -count=1 -coverprofile=coverage.out - record: runtime - - - name: Coverage - run: | - gocov convert coverage.out | gocov-xml > coverage.xml - - name: Coveritup - uses: kevincobain2000/action-coveritup@v2 - with: - type: coverage - command: ./cover-totalizer coverage.xml - - - name: Go Binary Size - uses: kevincobain2000/action-coveritup@v2 - with: - type: go-binary-size - command: du -sk gol | awk '{print $1}' - - - name: Number of dependencies - uses: kevincobain2000/action-coveritup@v2 - with: - type: go-mod-dependencies - command: go list -m all|wc -l|awk '{$1=$1};1' - - - uses: kevincobain2000/action-coveritup@v2 - with: - pr_comment: true - - uses: kevincobain2000/action-coveritup@v2 - with: - pr_comment: true - types: coverage,go-mod-dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..57d3058 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,50 @@ +on: + pull_request: + push: + tags-ignore: + - '**' + branches: + - '**' + +name: "Tests" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +jobs: + coveritup: + strategy: + matrix: + go-version: [latest] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: kevincobain2000/action-gobrew@v2 + with: + version: ${{ matrix.go-version }} + - name: Setup Node.js ${{ matrix.node-versions }} + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Install Tools + run: | + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh + - name: Setup Node.js ${{ matrix.node-versions }} + uses: actions/setup-node@v2 + with: + node-version: 20 + - uses: shogo82148/actions-setup-mysql@v1 + with: + mysql-version: "8.0" + + - run: cd frontend; npm install + - run: cd frontend; npm run check + + - run: cd frontend; npm run build + - run: go mod tidy;go build -ldflags '-s -w' -o gol frontend/main.go + - run: go mod tidy;go build + - run: golangci-lint run ./... + - run: go test -race -v ./... -count=1 -coverprofile=coverage.out + diff --git a/README.md b/README.md index c2ba8b1..11be573 100644 --- a/README.md +++ b/README.md @@ -68,25 +68,6 @@

-![npm-install-time](https://coveritup.app/badge?org=kevincobain2000&repo=gol&branch=master&type=npm-install-time) -![npm-build-time](https://coveritup.app/badge?org=kevincobain2000&repo=gol&branch=master&type=npm-build-time) -![go-build-cli-time](https://coveritup.app/badge?org=kevincobain2000&repo=gol&branch=master&type=go-build-cli-time) -![go-build-all-time](https://coveritup.app/badge?org=kevincobain2000&repo=gol&branch=master&type=go-build-all-time) - -![go-test-run-time](https://coveritup.app/badge?org=kevincobain2000&repo=gol&branch=master&type=go-test-run-time) -![coverage](https://coveritup.app/badge?org=kevincobain2000&repo=gol&branch=master&type=coverage) -![go-binary-size](https://coveritup.app/badge?org=kevincobain2000&repo=gol&branch=master&type=go-binary-size) -![go-mod-dependencies](https://coveritup.app/badge?org=kevincobain2000&repo=gol&branch=master&type=go-mod-dependencies) - -![npm-install-time](https://coveritup.app/chart?org=kevincobain2000&repo=gol&branch=master&type=npm-install-time&theme=light&line=fill&width=150&height=150&output=svg) -![npm-build-time](https://coveritup.app/chart?org=kevincobain2000&repo=gol&branch=master&type=npm-build-time&theme=light&line=fill&width=150&height=150&output=svg) -![go-build-cli-time](https://coveritup.app/chart?org=kevincobain2000&repo=gol&branch=master&type=go-build-cli-time&theme=light&line=fill&width=150&height=150&output=svg) -![go-build-all-time](https://coveritup.app/chart?org=kevincobain2000&repo=gol&branch=master&type=go-build-all-time&theme=light&line=fill&width=150&height=150&output=svg) -![go-test-run-time](https://coveritup.app/chart?org=kevincobain2000&repo=gol&branch=master&type=go-test-run-time&theme=light&line=fill&width=150&height=150&output=svg) -![coverage](https://coveritup.app/chart?org=kevincobain2000&repo=gol&branch=master&type=coverage&theme=light&line=fill&width=150&height=150&output=svg) -![go-binary-size](https://coveritup.app/chart?org=kevincobain2000&repo=gol&branch=master&type=go-binary-size&theme=light&line=fill&width=150&height=150&output=svg) -![go-mod-dependencies](https://coveritup.app/chart?org=kevincobain2000&repo=gol&branch=master&type=go-mod-dependencies&theme=light&line=fill&width=150&height=150&output=svg) - ### Install using curl