-
Notifications
You must be signed in to change notification settings - Fork 33
fix github actions #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix github actions #327
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,37 +11,35 @@ on: # yamllint disable-line rule:truthy | |
| types: | ||
| - "checks_requested" | ||
| jobs: | ||
| go-lint: | ||
| name: "Lint Go" | ||
| lint: | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - uses: "actions/checkout@v4" | ||
| - uses: "authzed/actions/setup-go@main" | ||
| - name: "Lint Go" | ||
| run: "go run magefile.go lint:go" | ||
| - name: "Go Mod Tidy" | ||
| with: | ||
| go-version-file: "go.mod" | ||
| - name: "Lint everything and check for tidy dependencies" | ||
| run: "go run magefile.go lint:all && go run magefile.go deps:tidy" | ||
|
Comment on lines
+21
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this chained as an |
||
| - name: "Check no diff" | ||
| uses: "chainguard-dev/actions/nodiff@main" | ||
| with: | ||
| path: "" | ||
| fixup-command: "go run magefile.go deps:tidy" | ||
| fixup-command: "go run magefile.go lint:all && go run magefile.go deps:tidy" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ran already above, why does it need to run again? |
||
| protobuf: | ||
| name: "Generate Protobufs" | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - uses: "actions/checkout@v4" | ||
| - uses: "authzed/actions/setup-go@main" | ||
| - uses: "chainguard-dev/actions/nodiff@main" | ||
| with: | ||
| go-version-file: "go.mod" | ||
| - name: "Generate Protos" | ||
| run: "go run magefile.go gen:all" | ||
| - name: "Check no diff" | ||
| uses: "chainguard-dev/actions/nodiff@main" | ||
| with: | ||
| path: "" | ||
| fixup-command: "go run magefile.go gen:proto" | ||
| extra-lint: | ||
| name: "Lint YAML" | ||
| runs-on: "ubuntu-latest" | ||
| steps: | ||
| - uses: "actions/checkout@v4" | ||
| - uses: "authzed/actions/setup-go@main" | ||
| - name: "Lint Go" | ||
| run: "go run magefile.go lint:extra" | ||
| fixup-command: "go run magefile.go gen:all" | ||
| codeql: | ||
| name: "Analyze with CodeQL" | ||
| runs-on: "ubuntu-latest" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,12 +12,18 @@ type Test mg.Namespace | |
|
|
||
| // All runs all test suites | ||
| func (t Test) All() error { | ||
| mg.Deps(t.Integration) | ||
| mg.Deps(t.Integration, t.Unit) | ||
| return nil | ||
| } | ||
|
|
||
| // Integration runs the unit tests | ||
| func (Test) Integration() error { | ||
| // Unit runs the unit tests | ||
| func (t Test) Unit() error { | ||
| fmt.Println("running unit tests") | ||
| return goTest("./...", "-tags", "integration", "-timeout", "10m") | ||
| return goTest("./...", "-race", "-count", "1", "-timeout", "20m") | ||
| } | ||
|
|
||
| // Integration runs the integration tests | ||
| func (Test) Integration() error { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The unit tests have a timeout of 20m, but the integration tests have a timeout of 1m? No race detector? |
||
| fmt.Println("running integration tests") | ||
| return goTest("./...", "-v", "-tags", "integration", "-timeout", "1m") | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| //go:build !integration | ||
|
|
||
| package validation_test | ||
|
|
||
| import ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| //go:build !integration | ||
|
|
||
| package validation_test | ||
|
|
||
| import ( | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I doubt anyone uses this, but this would be a breaking change, right? |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| //go:build integration | ||
|
|
||
| package authzed_test | ||
|
|
||
| import ( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to keep an eye on is that we are now running a more expensive lint job, whereas before we ran multiple concurrent lint operations. This means we are trading off smaller, faster jobs for one larger, more expensive job. That impacts the feedback loop (how long it takes for the developer to receive feedback from CI). This may not be a problem, but please keep an eye on the timing of these jobs.