Skip to content

ci: optimize jobs with path filtering #3074

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

Merged
merged 21 commits into from
Jul 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert to old docs method
  • Loading branch information
ammario committed Jul 23, 2022
commit c88149147590e5f94494ef4a6e6f2b9534eb15c5
32 changes: 26 additions & 6 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ on:
- main
tags:
- "*"
paths-ignore:
- "docs/**"

pull_request:
paths-ignore:
- "docs/**"
- ".github/**"

workflow_dispatch:

Expand All @@ -35,9 +30,25 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
all:
- '**'
docs:
- 'docs/**'
- '.github/**'
style-lint-golangci:
name: style/lint/golangci
timeout-minutes: 5
if: ${{ !needs.changes.outputs.docs_only }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -53,6 +64,7 @@ jobs:
name: style/lint/shellcheck
timeout-minutes: 5
runs-on: ubuntu-latest
if: ${{ !needs.changes.outputs.docs_only }}
steps:
- uses: actions/checkout@v3
- name: Run ShellCheck
Expand All @@ -65,6 +77,7 @@ jobs:
style-lint-typescript:
name: "style/lint/typescript"
timeout-minutes: 5
if: ${{ !needs.changes.outputs.docs_only }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -92,6 +105,7 @@ jobs:
name: "style/gen"
timeout-minutes: 5
runs-on: ubuntu-latest
if: ${{ !needs.changes.outputs.docs_only }}
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -127,6 +141,7 @@ jobs:

style-fmt:
name: "style/fmt"
if: ${{ !needs.changes.outputs.docs_only }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand Down Expand Up @@ -159,6 +174,7 @@ jobs:

test-go:
name: "test/go"
if: ${{ !needs.changes.outputs.docs_only }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
Expand Down Expand Up @@ -235,6 +251,7 @@ jobs:

test-go-postgres:
name: "test/go/postgres"
if: ${{ !needs.changes.outputs.docs_only }}
runs-on: ubuntu-latest
# This timeout must be greater than the timeout set by `go test` in
# `make test-postgres` to ensure we receive a trace of running
Expand Down Expand Up @@ -306,7 +323,9 @@ jobs:
name: "deploy"
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
if: |
github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
&& !needs.changes.outputs.docs_only
permissions:
contents: read
id-token: write
Expand Down Expand Up @@ -412,6 +431,7 @@ jobs:

test-js:
name: "test/js"
if: ${{ !needs.changes.outputs.docs_only }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand Down
6 changes: 0 additions & 6 deletions cli/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ func TestSSH(t *testing.T) {

// Shells on Mac, Windows, and Linux all exit shells with the "exit" command.
pty.WriteLine("exit")
// Read output to prevent hang on macOS, see:
// https://github.com/coder/coder/issues/2122
pty.ExpectMatch("exit")
<-cmdDone
})
t.Run("Stdio", func(t *testing.T) {
Expand Down Expand Up @@ -227,9 +224,6 @@ func TestSSH(t *testing.T) {

// And we're done.
pty.WriteLine("exit")
// Read output to prevent hang on macOS, see:
// https://github.com/coder/coder/issues/2122
pty.ExpectMatch("exit")
<-cmdDone
})
}
Expand Down
2 changes: 0 additions & 2 deletions docs/secrets.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Secrets

Blah blah...

<blockquote class="info">
This article explains how to use secrets in a workspace. To authenticate the
workspace provisioner, see <a href="./templates/authentication">this</a>.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ require (
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/afero v1.9.2
github.com/spf13/afero v1.9.0
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1699,8 +1699,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw=
github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
github.com/spf13/afero v1.9.0 h1:sFSLUHgxdnN32Qy38hK3QkYBFXZj9DKjVjCUCtD7juY=
github.com/spf13/afero v1.9.0/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dayjs.extend(timezone)

export const Language = {
errorNoDayOfWeek: "Must set at least one day of week if start time is set",
errorNoTime: "Start time is required when days of the week are selected",
errorNoTime: "Start time is required",
errorTime: "Time must be in HH:mm format (24 hours)",
errorTimezone: "Invalid timezone",
daysOfWeekLabel: "Days of Week",
Expand Down