diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 03fd46366a..3cb0eb0062 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,9 +1,9 @@ name: E2E -on: - push: - branches: [main] - pull_request: +#on: +# push: +# branches: [main] +# pull_request: jobs: install: @@ -27,3 +27,8 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Run E2E tests run: make e2e + + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 450bc79bb0..2267642223 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -1,11 +1,11 @@ name: Trigger example changes -on: - push: - branches: - - main - paths: - - 'examples/**' +#on: +# push: +# branches: +# - main +# paths: +# - 'examples/**' jobs: deploy-website: @@ -14,3 +14,8 @@ jobs: - run: curl -X POST "${{ env.WEBSITE_CLOUDFLARE_DEPLOY_HOOK }}" -v env: WEBSITE_CLOUDFLARE_DEPLOY_HOOK: ${{ secrets.WEBSITE_CLOUDFLARE_DEPLOY_HOOK }} + + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index c9931e3930..febd71eada 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -10,7 +10,7 @@ jobs: name: lint strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -22,10 +22,25 @@ jobs: run: | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.50.1 ./bin/golangci-lint run --verbose + - name: Extract Issue Count + if: always() + id: issues + uses: sergeysova/jq-action@v2 + with: + cmd: 'jq ".Issues | length" golangci.json -r' + - name: Write Issue Count & Copy File + if: always() + run: | + echo '{ "issues": ${{ steps.issues.outputs.value }} }' > ${{ matrix.os }}-issues.json + cp golangci.html ${{ matrix.os }}-golangci.html + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + test: strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -34,4 +49,30 @@ jobs: with: go-version: 1.18 - name: Test - run: go test -race ./... + run: | + go install gotest.tools/gotestsum@latest + gotestsum --jsonfile tests.jsonl -- -race -coverprofile=coverage.out ./... + - name: Write Success + if: ${{ success() }} + run: | + echo '{ "success": true }' > ${{ matrix.os }}-status.json + - name: Write Failure + if: ${{ failure() }} + run: | + echo '{ "success": false }' > ${{ matrix.os }}-status.json + - name: Generate Test HTML + if: always() + run: | + go install github.com/vakenbolt/go-test-report@latest + cat tests.jsonl | go-test-report -o ${{ matrix.os }}-junit.html + - name: Generate Coverage HTML + if: always() + run: go tool cover -o coverage.html -html=coverage.out + - name: Generate Coverage Treemap + if: always() + run: | + go install github.com/nikolaydubina/go-cover-treemap@latest + go-cover-treemap -h 240 -padding 0 -coverprofile coverage.out > coverage.svg + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc61f6acda..e85afccc41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,9 @@ name: Release -on: - push: - tags: - - "v*" +#on: +# push: +# tags: +# - "v*" jobs: goreleaser: @@ -34,6 +34,11 @@ jobs: args: release --rm-dist --debug env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + npm: runs-on: ubuntu-latest needs: [goreleaser] @@ -68,3 +73,8 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Run Stoat Action + uses: stoat-dev/stoat-action@v0 + if: always() + + diff --git a/.gitignore b/.gitignore index e53e6f591c..847a3f46e3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,17 @@ testfns/ main pkg/devserver/index.html + +.DS_Store +.idea +coverage.out +coverage.svg +coverage.html +golangci.html +golangci.json +bin +tests.jsonl +tests.html +issues.json +junit.xml +junit.html diff --git a/.golangci.json b/.golangci.json index bac597e4ec..c0ee8890e7 100644 --- a/.golangci.json +++ b/.golangci.json @@ -5,7 +5,16 @@ ], "timeout": "10m" }, + "output": { + "format": "colored-line-number:stdout,html:golangci.html,json:golangci.json" + }, + "linters": { + "enable": ["misspell"] + }, "linters-settings": { + "misspell": { + "ignore-words": [] + }, "staticcheck": { "checks": [ "all", diff --git a/.stoat/comment.hbs b/.stoat/comment.hbs new file mode 100644 index 0000000000..7b7a2ce120 --- /dev/null +++ b/.stoat/comment.hbs @@ -0,0 +1,35 @@ +### Build Results + + + + + + + + + + + + +
Linter + + {{#if plugins.json.ubuntu_issues.value.issues}} + {{ plugins.static_hosting.ubuntu_linter.sha }} failing + {{ else }} + {{ plugins.static_hosting.ubuntu_linter.sha }} passing + {{/if}} + + {{ plugins.static_hosting.ubuntu_linter.sha }}
Tests + + {{#if plugins.json.status.value.success}} + {{ plugins.static_hosting.ubuntu_linter.sha }} passing + {{ else }} + {{ plugins.static_hosting.ubuntu_linter.sha }} failing + {{/if}} + + {{ plugins.static_hosting.ubuntu_linter.sha }}
+ +### Test Coverage +[![test coverage]({{ plugins.static_hosting.coverage_image.link }})]({{ plugins.static_hosting.coverage_html.link }}) + +{{{ views.plugins.job_runtime.github.chart }}} diff --git a/.stoat/config.yaml b/.stoat/config.yaml new file mode 100644 index 0000000000..4b64ceed02 --- /dev/null +++ b/.stoat/config.yaml @@ -0,0 +1,21 @@ +--- +version: 1 +enabled: true +comment_template_file: ".stoat/comment.hbs" +plugins: + job_runtime: + enabled: true + json: + ubuntu_issues: + path: ubuntu-latest-issues.json + status: + path: ubuntu-latest-status.json + static_hosting: + coverage_image: + path: coverage.svg + coverage_html: + path: coverage.html + ubuntu_linter: + path: ubuntu-latest-golangci.html + ubuntu_test_html: + path: ubuntu-latest-junit.html diff --git a/pkg/execution/state/redis_state/queue_test.go b/pkg/execution/state/redis_state/queue_test.go index d763efc5b2..b1fff77b40 100644 --- a/pkg/execution/state/redis_state/queue_test.go +++ b/pkg/execution/state/redis_state/queue_test.go @@ -64,7 +64,7 @@ func TestQueueEnqueueItem(t *testing.T) { require.Equal(t, QueuePartition{ WorkflowID: item.WorkflowID, Priority: testPriority, - AtS: start.Unix(), + AtS: start.Unix() + 1, }, qp) // Ensure that the zscore did not change.