Skip to content

Commit aaf6132

Browse files
authored
ci: switch to flow gha (#70)
Update project executables and switch to using the flow github action
1 parent 7a27cdb commit aaf6132

File tree

9 files changed

+268
-159
lines changed

9 files changed

+268
-159
lines changed

.github/workflows/ci.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
permissions:
9+
contents: read # for actions/checkout to fetch code
10+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: "^1.24"
25+
- uses: jahvon/flow-action@v1.0.0-beta2
26+
with:
27+
executable: 'lint --param CI=true'
28+
timeout: '5m'
29+
flow-version: 'main'
30+
- name: Upload SARIF file
31+
uses: github/codeql-action/upload-sarif@v3
32+
with:
33+
sarif_file: lint.sarif
34+
category: golangci-lint
35+
36+
tests:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Set up Go
41+
uses: actions/setup-go@v5
42+
with:
43+
go-version: "^1.24"
44+
- uses: jahvon/flow-action@v1.0.0-beta2
45+
with:
46+
executable: 'test tui --param CI=true'
47+
timeout: '5m'
48+
flow-version: 'main'
49+
- name: Upload to codecov
50+
uses: codecov/codecov-action@v3
51+
env:
52+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
53+
with:
54+
file: coverage.out
55+
fail_ci_if_error: true
56+
57+
validate-generated:
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v4
61+
- name: Set up Go
62+
uses: actions/setup-go@v5
63+
with:
64+
go-version: "^1.24"
65+
- name: Install mockgen
66+
run: go install go.uber.org/mock/mockgen@v0.4.0
67+
- uses: jahvon/flow-action@v1.0.0-beta2
68+
with:
69+
executable: 'generate'
70+
timeout: '10m'
71+
flow-version: 'main'
72+
- name: Check for uncommitted changes
73+
uses: jahvon/flow-action@v1.0.0-beta2
74+
with:
75+
executable: 'validate generated'
76+
timeout: '2m'
77+
flow-version: 'main'
78+
79+
security:
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
- name: Set up Go
84+
uses: actions/setup-go@v5
85+
with:
86+
go-version: "^1.24"
87+
- uses: jahvon/flow-action@v1.0.0-beta2
88+
with:
89+
executable: 'scan security'
90+
timeout: '10m'
91+
flow-version: 'main'
92+
- name: Upload govuln SARIF file
93+
uses: github/codeql-action/upload-sarif@v3
94+
with:
95+
sarif_file: govuln.sarif

.github/workflows/validate.yaml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
1-
# Binaries for programs and plugins
21
*.exe
32
*.exe~
43
*.dll
54
*.so
65
*.dylib
76
.DS_Store
8-
9-
# Test binary, built with `go test -c`
107
*.test
11-
12-
# Output of the go coverage tool, specifically when used with LiteIDE
8+
bin/
139
*.out
14-
15-
# Dependency directories (remove the comment below to include it)
16-
# vendor/
17-
18-
# Code coverage
1910
coverage.txt
20-
21-
# IDE
11+
*.sarif
2212
.idea
2313

container_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestFrameOutput(t *testing.T) {
4040

4141
container.Send(tea.Quit(), 100*time.Millisecond)
4242
tm.WaitFinished(t, teatest.WithFinalTimeout(time.Second))
43-
out, err := io.ReadAll(tm.Output())
43+
out, err := io.ReadAll(tm.FinalOutput(t))
4444
if err != nil {
4545
t.Error(err)
4646
}
@@ -165,7 +165,7 @@ func TestCollectionOutput(t *testing.T) {
165165
t.Errorf("Failed to set view: %v", err)
166166
}
167167

168-
container.Send(tea.Quit(), 500*time.Millisecond)
168+
container.Send(tea.Quit(), 10*time.Millisecond)
169169
tm.WaitFinished(t, teatest.WithFinalTimeout(time.Second))
170170
out, err := io.ReadAll(tm.FinalOutput(t))
171171
if err != nil {

dev.flow

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)