only run actions on /src changes (#750)

## Description

Re-opening the PR with a hack (sourced from github
themselves) to skip the required check if we don't run
the standard required jobs.

## Type of change

- [x] 🌻 Feature

## Issue(s)

#744

## Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
Keepers 2022-09-02 16:30:18 -06:00 committed by GitHub
parent 0227bba7ac
commit 1f8c3cdb11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 5 deletions

30
.github/workflows/ci-skip.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: CI Tests
on:
push:
branches: [main]
paths-ignore:
- '/src/**'
- '/.github/**'
pull_request:
branches: [main]
paths-ignore:
- '/src/**'
- '/.github/**'
# Intentional no-op used to tell the build system that
# required actions like Test-Suite and Linting have passed
# successfully, even though they were skipped.
# This hack brought to you by docs.github.com
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
jobs:
Test-Suite:
runs-on: ubuntu-latest
steps:
- run: 'echo "Build step skipped - no testing required" '
Linting:
runs-on: ubuntu-latest
steps:
- run: 'echo "Build step skipped - no linting required" '

View File

@ -2,13 +2,18 @@ name: CI Tests
on: on:
push: push:
branches: [main] branches: [main]
paths:
- '/src/**'
- '/.github/**'
pull_request: pull_request:
branches: [main] branches: [main]
paths:
- '/src/**'
- '/.github/**'
permissions: permissions:
# required to retrieve AWS credentials # required to retrieve AWS credentials
id-token: write id-token: write
# required to retrieve repository
contents: read contents: read
jobs: jobs:
@ -19,7 +24,8 @@ jobs:
run: run:
working-directory: src working-directory: src
steps: steps:
- name: Repo Code Checkout
- name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
# Get values for cache paths to be used in later steps # Get values for cache paths to be used in later steps

View File

@ -2,6 +2,9 @@ name: Document Generation
on: on:
push: push:
branches: [main] branches: [main]
paths:
- '/src/**'
- '/.github/**'
permissions: permissions:
contents: write contents: write
@ -13,12 +16,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# check out the repo
- name: Repo Code Checkout - name: Repo Code Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: ${{ github.event.pull_request.head.ref }} ref: ${{ github.event.pull_request.head.ref }}
# persist-credentials: false
# Get values for cache paths to be used in later steps # Get values for cache paths to be used in later steps
- id: go-cache-paths - id: go-cache-paths

View File

@ -2,6 +2,9 @@ name: Publish Docker Container Images
on: on:
push: push:
branches: [main] branches: [main]
paths:
- '/src/**'
- '/.github/**'
permissions: permissions:
contents: read contents: read
@ -16,6 +19,7 @@ jobs:
env: env:
PLATFORMS: linux/amd64,linux/arm64 PLATFORMS: linux/amd64,linux/arm64
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3

View File

@ -2,8 +2,17 @@ name: Lint
on: on:
push: push:
branches: [main] branches: [main]
paths:
- '/src/**'
- '/.github/**'
pull_request: pull_request:
branches: [main] branches: [main]
paths:
- '/src/**'
- '/.github/**'
permissions:
contents: read
jobs: jobs:
Linting: Linting:
@ -13,7 +22,8 @@ jobs:
run: run:
working-directory: src working-directory: src
steps: steps:
- name: Checkout src code
- name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
# Get values for cache paths to be used in later steps # Get values for cache paths to be used in later steps