Skip to content

Commit

Permalink
chore: streamline workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
drstrangelooker committed Oct 24, 2023
1 parent 2135c87 commit 4e60192
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 118 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/apix-ci.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
name: API Explorer CI
on:
pull_request:
paths:
- package.json
- packages/code-editor/**
- packages/run-it/**
- packages/api-explorer/**
- packages/extension-api-explorer/**
- packages/extension-utils/**
- .github/workflows/apix-ci.yml

push:
branches:
- main
paths:
- package.json
- packages/code-editor/**
- packages/run-it/**
- packages/api-explorer/**
- packages/extension-api-explorer/**
- packages/extension-utils/**
- .github/workflows/apix-ci.yml

workflow_dispatch:

env:
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/codegen-ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
name: Codegen CI
on:
pull_request:
paths:
- package.json
- packages/sdk-codegen/**
- packages/sdk-codegen-utils/**
- packages/sdk-codegen-scripts/**
- .github/workflows/codegen-ci.yml

push:
branches:
- main
paths:
- package.json
- packages/sdk-codegen/**
- packages/sdk-codegen-utils/**
- packages/sdk-codegen-scripts/**
- .github/workflows/codegen-ci.yml

workflow_dispatch:

env:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
name: Go SDK CI
on:
pull_request:
paths:
- go/**
- .github/workflows/go-ci.yml

push:
branches:
- main
paths:
- go/**
- .github/workflows/go-ci.yml

workflow_dispatch:

env:
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/hackathon-ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
name: Hackathon CI
on:
pull_request:
paths:
- package.json
- packages/wholly-artifact/**
- packages/hackathon/**
- .github/workflows/hackathon-ci.yml

push:
branches:
- main
paths:
- package.json
- packages/wholly-artifact/**
- packages/hackathon/**
- .github/workflows/hackathon-ci.yml

workflow_dispatch:

env:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
name: Python CI
on:
pull_request:
paths:
- python/**
- .github/workflows/python-ci.yml

push:
branches:
- main
paths:
- python/**
- .github/workflows/python-ci.yml

workflow_dispatch:

env:
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/required-checks-hack-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

name: Required Checks Hack
on:
workflow_dispatch:

pull_request:

push:
Expand All @@ -29,6 +31,7 @@ on:

permissions:
checks: write
actions: write

jobs:
satisfy-required-checks:
Expand Down Expand Up @@ -92,8 +95,33 @@ jobs:
echo "resources: ${{ steps.filter.outputs.resources }}"
echo "tssdk: ${{ steps.filter.outputs.tssdk }}"
echo "gosdk: ${{ steps.filter.outputs.gosdk }}"
echo "ref: ${{ github.ref }}"
- name: Lookup Workflows
id: lookup_workflows
run: |
response=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/looker-open-source/sdk-codegen/actions/workflows)
echo "workflows=$(jq -c '.workflows | map({id: .id,name: .name})' <<< $response)"
echo "workflows=$(jq -c '.workflows | map({id: .id,name: .name})' <<< $response)" >> "$GITHUB_OUTPUT"
- name: Create Codegen check
if: steps.filter.outputs.codegen != 'false'
run: |
workflow_id=$(echo '${{ steps.lookup_workflows.outputs.workflows }}' | jq '.[] | select( .name == "Codegen CI" ) .id')
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/looker-open-source/sdk-codegen/actions/workflows/$workflow_id/dispatches \
-d "{\"ref\": \"${{ github.ref }}\"}"
- name: Create No Op Codegen check
if: steps.filter.outputs.codegen == 'false'
run: |
curl --request POST \
Expand All @@ -113,6 +141,18 @@ jobs:
--fail
- name: Create Typescript check
if: steps.filter.outputs.tssdk != 'false'
run: |
workflow_id=$(echo '${{ steps.lookup_workflows.outputs.workflows }}' | jq '.[] | select( .name == "TypeScript SDK CI" ) .id')
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/looker-open-source/sdk-codegen/actions/workflows/$workflow_id/dispatches \
-d "{\"ref\": \"${{ github.ref }}\"}"
- name: Create No Op Typescript check
if: steps.filter.outputs.tssdk == 'false'
run: |
curl --request POST \
Expand All @@ -132,6 +172,18 @@ jobs:
--fail
- name: Create Python check
if: steps.filter.outputs.python != 'false'
run: |
workflow_id=$(echo '${{ steps.lookup_workflows.outputs.workflows }}' | jq '.[] | select( .name == "Python CI" ) .id')
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/looker-open-source/sdk-codegen/actions/workflows/$workflow_id/dispatches \
-d "{\"ref\": \"${{ github.ref }}\"}"
- name: Create No Op Python check
if: steps.filter.outputs.python == 'false'
run: |
curl --request POST \
Expand All @@ -151,6 +203,18 @@ jobs:
--fail
- name: Create APIX check
if: steps.filter.outputs.apix != 'false'
run: |
workflow_id=$(echo '${{ steps.lookup_workflows.outputs.workflows }}' | jq '.[] | select( .name == "API Explorer CI" ) .id')
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/looker-open-source/sdk-codegen/actions/workflows/$workflow_id/dispatches \
-d "{\"ref\": \"${{ github.ref }}\"}"
- name: Create No Op APIX check
if: steps.filter.outputs.apix == 'false'
run: |
curl --request POST \
Expand All @@ -170,6 +234,18 @@ jobs:
--fail
- name: Create Go check
if: steps.filter.outputs.gosdk != 'false'
run: |
workflow_id=$(echo '${{ steps.lookup_workflows.outputs.workflows }}' | jq '.[] | select( .name == "Go SDK CI" ) .id')
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/looker-open-source/sdk-codegen/actions/workflows/$workflow_id/dispatches \
-d "{\"ref\": \"${{ github.ref }}\"}"
- name: Create No Op Go check
if: steps.filter.outputs.gosdk == 'false'
run: |
curl --request POST \
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/resources-ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
name: Resources Index CI
on:
pull_request:
paths:
- bin/looker-resources-index/**
- docs/resources/**
- .github/workflows/resources-ci.yml

push:
branches:
- main
paths:
- bin/looker-resources-index/**
- docs/resources/**
- .github/workflows/resources-ci.yml

workflow_dispatch:

defaults:
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/tssdk-ci.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
name: TypeScript SDK CI
on:
pull_request:
paths:
- package.json
- packages/sdk/**
- packages/sdk-rtl/**
- packages/sdk-node/**
- packages/extension-sdk/**
- packages/extension-sdk-react/**
- packages/extension-utils/**
- .github/workflows/tssdk-ci.yml

push:
branches:
- main
paths:
- package.json
- packages/sdk/**
- packages/sdk-rtl/**
- packages/sdk-node/**
- packages/extension-sdk/**
- packages/extension-sdk-react/**
- packages/extension-utils/**
- .github/workflows/tssdk-ci.yml

workflow_dispatch:

env:
Expand Down

0 comments on commit 4e60192

Please sign in to comment.