Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: E2E

on:
push:
branches: [main]
pull_request:
#on:
# push:
# branches: [main]
# pull_request:

jobs:
install:
Expand All @@ -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()

17 changes: 11 additions & 6 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Trigger example changes

on:
push:
branches:
- main
paths:
- 'examples/**'
#on:
# push:
# branches:
# - main
# paths:
# - 'examples/**'

jobs:
deploy-website:
Expand All @@ -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()

47 changes: 44 additions & 3 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()
18 changes: 14 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release

on:
push:
tags:
- "v*"
#on:
# push:
# tags:
# - "v*"

jobs:
goreleaser:
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -68,3 +73,8 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Run Stoat Action
uses: stoat-dev/stoat-action@v0
if: always()


14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions .golangci.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
35 changes: 35 additions & 0 deletions .stoat/comment.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### Build Results

<table>
<tr>
<td><strong>Linter</strong></td>
<td>
<a href="{{ plugins.static_hosting.ubuntu_linter.link }}">
{{#if plugins.json.ubuntu_issues.value.issues}}
<img src="https://img.shields.io/badge/ubuntu-{{ plugins.json.ubuntu_issues.value.issues }}%20issues-red.svg?style=flat" alt="{{ plugins.static_hosting.ubuntu_linter.sha }} failing">
{{ else }}
<img src="https://img.shields.io/badge/ubuntu-passing-brightgreen.svg?style=flat" alt="{{ plugins.static_hosting.ubuntu_linter.sha }} passing">
{{/if}}
</a>
</td>
<td>{{ plugins.static_hosting.ubuntu_linter.sha }}</td>
</tr>
<tr>
<td><strong>Tests</strong></td>
<td>
<a href="{{ plugins.static_hosting.ubuntu_test_html.link }}">
{{#if plugins.json.status.value.success}}
<img src="https://img.shields.io/badge/ubuntu-passing-brightgreen.svg?style=flat" alt="{{ plugins.static_hosting.ubuntu_linter.sha }} passing">
{{ else }}
<img src="https://img.shields.io/badge/ubuntu-failed-red.svg?style=flat" alt="{{ plugins.static_hosting.ubuntu_linter.sha }} failing">
{{/if}}
</a>
</td>
<td>{{ plugins.static_hosting.ubuntu_linter.sha }}</td>
</tr>
</table>

### Test Coverage
[![test coverage]({{ plugins.static_hosting.coverage_image.link }})]({{ plugins.static_hosting.coverage_html.link }})

{{{ views.plugins.job_runtime.github.chart }}}
21 changes: 21 additions & 0 deletions .stoat/config.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion pkg/execution/state/redis_state/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down