Skip to content

ci: skip long jobs when only docs change #3072

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 2 commits into from
Jul 20, 2022
Merged
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
use kyle's method
  • Loading branch information
ammario committed Jul 20, 2022
commit fec285c7dd4361a1a3ff134ff4d23d91bbd9d586
28 changes: 3 additions & 25 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- main
tags:
- "*"
paths-ignore:
- "docs/**"

pull_request:

Expand All @@ -30,24 +32,9 @@ 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/**'
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 @@ -63,7 +50,6 @@ 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 @@ -76,7 +62,6 @@ 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 @@ -104,7 +89,6 @@ 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 @@ -140,7 +124,6 @@ jobs:

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

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

test-go-postgres:
name: "test/go/postgres"
if: ${{ needs.changes.outputs.docs_only }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand Down Expand Up @@ -312,9 +293,7 @@ jobs:
name: "deploy"
runs-on: ubuntu-latest
timeout-minutes: 30
if: |
github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
&& !needs.changes.outputs.docs_only
if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
permissions:
contents: read
id-token: write
Expand Down Expand Up @@ -420,7 +399,6 @@ jobs:

test-js:
name: "test/js"
if: ${{ needs.changes.outputs.docs_only }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand Down