mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
Skip unnessary workflow checks (#2872)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
33
.github/workflows/checks.yml
vendored
33
.github/workflows/checks.yml
vendored
@@ -32,9 +32,25 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
fileschanged:
|
||||
name: List files changed for pull request
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Fetch source code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- id: diff
|
||||
run: |
|
||||
echo "Comparing head_commit ${{github.event.push.head_commit}} to base_ref ${{github.event.push.base_ref}}"
|
||||
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{github.event.pull_request.base.ref}}
|
||||
echo "go=$(git diff --name-only origin/${{github.event.pull_request.base.ref}} | grep '\.go' | wc -l)" | tee -a "$GITHUB_OUTPUT"
|
||||
outputs:
|
||||
go: ${{ steps.diff.outputs.go }}
|
||||
|
||||
unit-tests:
|
||||
name: Unit tests for ${{ matrix.goos }}_${{ matrix.goarch }}
|
||||
runs-on: ${{ matrix.runson }}
|
||||
needs: fileschanged
|
||||
if: ${{ needs.fileschanged.outputs.go != 0}}
|
||||
env:
|
||||
TF_APPEND_USER_AGENT: Integration-Test
|
||||
GOOS: ${{ matrix.goos }}
|
||||
@@ -88,6 +104,8 @@ jobs:
|
||||
race-tests:
|
||||
name: "Race Tests"
|
||||
runs-on: ubuntu-latest
|
||||
needs: fileschanged
|
||||
if: ${{ needs.fileschanged.outputs.go != 0}}
|
||||
|
||||
steps:
|
||||
- name: "Fetch source code"
|
||||
@@ -126,6 +144,8 @@ jobs:
|
||||
# that might leak through this.
|
||||
name: "End-to-end Tests"
|
||||
runs-on: ubuntu-latest
|
||||
needs: fileschanged
|
||||
if: ${{ needs.fileschanged.outputs.go != 0}}
|
||||
|
||||
steps:
|
||||
- name: "Fetch source code"
|
||||
@@ -158,6 +178,8 @@ jobs:
|
||||
consistency-checks:
|
||||
name: "Code Consistency Checks"
|
||||
runs-on: ubuntu-latest
|
||||
needs: fileschanged
|
||||
if: ${{ needs.fileschanged.outputs.go != 0}}
|
||||
|
||||
steps:
|
||||
- name: "Fetch source code"
|
||||
@@ -266,14 +288,3 @@ jobs:
|
||||
with:
|
||||
path: ".licensei.cache"
|
||||
key: licensei-cache-${{ hashFiles('go.sum') }}
|
||||
|
||||
installation-instructions:
|
||||
name: "Test Installation Instructions"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: "Fetch source code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: "Run Installation Instructions Test"
|
||||
run: make test-linux-install-instructions
|
||||
|
||||
16
.github/workflows/compare-snapshots.yml
vendored
16
.github/workflows/compare-snapshots.yml
vendored
@@ -10,9 +10,25 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
fileschanged:
|
||||
name: List files changed for pull request
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Fetch source code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- id: diff
|
||||
run: |
|
||||
echo "Comparing head_commit ${{github.event.push.head_commit}} to base_ref ${{github.event.push.base_ref}}"
|
||||
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{github.event.pull_request.base.ref}}
|
||||
echo "go=$(git diff --name-only origin/${{github.event.pull_request.base.ref}} | grep '\.go' | wc -l)" | tee -a "$GITHUB_OUTPUT"
|
||||
outputs:
|
||||
go: ${{ steps.diff.outputs.go }}
|
||||
|
||||
compare:
|
||||
name: Compare
|
||||
runs-on: ubuntu-latest
|
||||
needs: fileschanged
|
||||
if: ${{ needs.fileschanged.outputs.go != 0}}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
31
.github/workflows/website.yml
vendored
31
.github/workflows/website.yml
vendored
@@ -10,9 +10,27 @@ on:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
jobs:
|
||||
fileschanged:
|
||||
name: List files changed for pull request
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Fetch source code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- id: diff
|
||||
run: |
|
||||
echo "Comparing current commit to base ref origin/${{github.event.pull_request.base.ref}}"
|
||||
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{github.event.pull_request.base.ref}}
|
||||
echo "install=$(git diff --name-only origin/${{github.event.pull_request.base.ref}} | grep 'website/docs/intro/install' | wc -l)" | tee -a "$GITHUB_OUTPUT"
|
||||
echo "website=$(git diff --name-only origin/${{github.event.pull_request.base.ref}} | grep 'website/' | wc -l)" | tee -a "$GITHUB_OUTPUT"
|
||||
outputs:
|
||||
install: ${{ steps.diff.outputs.install }}
|
||||
website: ${{ steps.diff.outputs.website }}
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
needs: fileschanged
|
||||
if: ${{ needs.fileschanged.outputs.website != 0}}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -24,3 +42,16 @@ jobs:
|
||||
- name: Build website
|
||||
run: docker compose -f docker-compose.build.yml up --exit-code-from website
|
||||
working-directory: website
|
||||
|
||||
installation-instructions:
|
||||
name: "Test Installation Instructions"
|
||||
runs-on: ubuntu-latest
|
||||
needs: fileschanged
|
||||
if: ${{ needs.fileschanged.outputs.install != 0}}
|
||||
|
||||
steps:
|
||||
- name: "Fetch source code"
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: "Run Installation Instructions Test"
|
||||
run: make test-linux-install-instructions
|
||||
|
||||
Reference in New Issue
Block a user