mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 00:45:07 +03:00
GHA gardening (#1299)
This commit is contained in:
parent
c84784be07
commit
e36f971356
9 changed files with 116 additions and 150 deletions
66
.github/actions/complain/action.yml
vendored
Normal file
66
.github/actions/complain/action.yml
vendored
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
name: tea/pantry/complain
|
||||||
|
description: creates an issue for failure conditions
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
projects:
|
||||||
|
description: projects to complain about
|
||||||
|
required: true
|
||||||
|
platform:
|
||||||
|
description: platform key
|
||||||
|
required: true
|
||||||
|
token:
|
||||||
|
required: true
|
||||||
|
default: ${{ github.token }}
|
||||||
|
slack-webhook:
|
||||||
|
required: false
|
||||||
|
slack-channel:
|
||||||
|
required: false
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Find Issue
|
||||||
|
uses: actions-cool/issues-helper@v3
|
||||||
|
id: find
|
||||||
|
with:
|
||||||
|
actions: 'find-issues'
|
||||||
|
token: ${{ inputs.token }}
|
||||||
|
issue-state: 'open'
|
||||||
|
title-includes: "❌ build issues: ${{ inputs.projects }}"
|
||||||
|
labels: 'build-failure'
|
||||||
|
|
||||||
|
- name: Create Issue
|
||||||
|
uses: actions-cool/issues-helper@v3
|
||||||
|
id: create
|
||||||
|
if: ${{ steps.find.outputs.issues == '[]' }}
|
||||||
|
with:
|
||||||
|
actions: 'create-issue'
|
||||||
|
token: ${{ inputs.token }}
|
||||||
|
title: "❌ build issues: ${{ inputs.projects }}"
|
||||||
|
body: "Running log of build failures for ${{ inputs.projects }}"
|
||||||
|
labels: 'build-failure'
|
||||||
|
assignees: 'jhheider'
|
||||||
|
|
||||||
|
- name: Log Comment
|
||||||
|
uses: actions-cool/issues-helper@v3
|
||||||
|
with:
|
||||||
|
actions: 'create-comment'
|
||||||
|
token: ${{ inputs.token }}
|
||||||
|
issue-number: ${{ steps.create.outputs.issue-number || fromJSON(steps.find.outputs.issues)[0].number }}
|
||||||
|
body: |
|
||||||
|
# Build failure
|
||||||
|
## ${{ inputs.projects }}
|
||||||
|
### ${{ inputs.platform }}
|
||||||
|
|
||||||
|
logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
|
|
||||||
|
- uses: martialonline/workflow-status@v3
|
||||||
|
id: status
|
||||||
|
|
||||||
|
- uses: rtCamp/action-slack-notify@v2
|
||||||
|
if: ${{ inputs.slack-webhook != '' }}
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK: ${{ inputs.slack-webhook }}
|
||||||
|
SLACK_CHANNEL: ${{ inputs.slack-channel }}
|
||||||
|
SLACK_MESSAGE: new-version:${{ inputs.projects }} (${{ inputs.platform }}) ${{ steps.status.outputs.status }}
|
||||||
|
SLACK_COLOR: ${{ steps.status.outputs.status }}
|
9
.github/workflows/bottle.yml
vendored
9
.github/workflows/bottle.yml
vendored
|
@ -155,12 +155,3 @@ jobs:
|
||||||
AWS_REGION: us-east-1
|
AWS_REGION: us-east-1
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
|
||||||
complain:
|
|
||||||
needs: [upload]
|
|
||||||
if: inputs.new-version == 'true' && failure()
|
|
||||||
uses: ./.github/workflows/complain.yml
|
|
||||||
with:
|
|
||||||
projects: ${{ inputs.projects }}
|
|
||||||
platform: ${{ inputs.platform }}
|
|
||||||
secrets: inherit
|
|
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
|
@ -9,10 +9,6 @@ on:
|
||||||
platform:
|
platform:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
new-version:
|
|
||||||
type: boolean
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-platform:
|
get-platform:
|
||||||
|
@ -140,24 +136,6 @@ jobs:
|
||||||
env:
|
env:
|
||||||
HAS_SECRETS: ${{ secrets.AWS_S3_CACHE != null }}
|
HAS_SECRETS: ${{ secrets.AWS_S3_CACHE != null }}
|
||||||
|
|
||||||
bottle:
|
|
||||||
needs: [test]
|
|
||||||
if: inputs.new-version == true
|
|
||||||
uses: ./.github/workflows/bottle.yml
|
|
||||||
with:
|
|
||||||
new-version: ${{ inputs.new-version }}
|
|
||||||
platform: ${{ inputs.platform }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
complain:
|
|
||||||
needs: [test]
|
|
||||||
if: inputs.new-version == true && failure()
|
|
||||||
uses: ./.github/workflows/complain.yml
|
|
||||||
with:
|
|
||||||
projects: ${{ inputs.projects }}
|
|
||||||
platform: ${{ inputs.platform }}
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
stage:
|
stage:
|
||||||
needs: [test]
|
needs: [test]
|
||||||
# this only works for PRs from our team to our repo (security! :( )
|
# this only works for PRs from our team to our repo (security! :( )
|
||||||
|
|
1
.github/workflows/cd.yml
vendored
1
.github/workflows/cd.yml
vendored
|
@ -12,6 +12,7 @@ jobs:
|
||||||
has-artifacts: ${{ steps.has-artifacts.outputs.has-artifacts }}
|
has-artifacts: ${{ steps.has-artifacts.outputs.has-artifacts }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
# ^^ NOTE probably no longer required but I don’t dare try to remove it
|
||||||
|
|
||||||
- uses: teaxyz/brewkit/actions/setup-brewkit@v0
|
- uses: teaxyz/brewkit/actions/setup-brewkit@v0
|
||||||
|
|
||||||
|
|
20
.github/workflows/ci-scripts.yml
vendored
20
.github/workflows/ci-scripts.yml
vendored
|
@ -1,20 +0,0 @@
|
||||||
name: ci·scripts
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- .github/**.ts
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
typecheck:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: teaxyz/setup@v0
|
|
||||||
with:
|
|
||||||
srcroot: .github
|
|
||||||
- uses: teaxyz/brewkit/actions/cache@v0
|
|
||||||
with:
|
|
||||||
cache-name: ci-scripts
|
|
||||||
- run: deno check --unstable **/*.ts
|
|
||||||
working-directory: .github
|
|
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -4,7 +4,7 @@ run-name: 'ci: ${{ github.event.pull_request.title }}'
|
||||||
on: pull_request
|
on: pull_request
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-diff:
|
get-projects:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
diff: ${{ steps.diff.outputs.diff }}
|
diff: ${{ steps.diff.outputs.diff }}
|
||||||
|
@ -21,7 +21,7 @@ jobs:
|
||||||
RESULT="$RESULT $y"
|
RESULT="$RESULT $y"
|
||||||
done
|
done
|
||||||
echo "diff=$RESULT" >> $GITHUB_OUTPUT
|
echo "diff=$RESULT" >> $GITHUB_OUTPUT
|
||||||
ci:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -30,9 +30,9 @@ jobs:
|
||||||
- linux+x86-64
|
- linux+x86-64
|
||||||
- darwin+aarch64
|
- darwin+aarch64
|
||||||
- linux+aarch64
|
- linux+aarch64
|
||||||
needs: [get-diff]
|
needs: [get-projects]
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
with:
|
with:
|
||||||
projects: ${{ needs.get-diff.outputs.diff || 'zlib.net^1.2' }}
|
projects: ${{ needs.get-projects.outputs.diff || 'zlib.net^1.2' }}
|
||||||
platform: ${{ matrix.platform }}
|
platform: ${{ matrix.platform }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
64
.github/workflows/complain.yml
vendored
64
.github/workflows/complain.yml
vendored
|
@ -1,64 +0,0 @@
|
||||||
name: complain
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
projects:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
platform:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
complain:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Find issue
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
id: find
|
|
||||||
with:
|
|
||||||
actions: 'find-issues'
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
issue-state: 'open'
|
|
||||||
title-includes: "❌ build issues: ${{ inputs.projects }}"
|
|
||||||
labels: 'build-failure'
|
|
||||||
|
|
||||||
- name: Create issue
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
id: create
|
|
||||||
if: ${{ steps.find.outputs.issues == '[]' }}
|
|
||||||
with:
|
|
||||||
actions: 'create-issue'
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
title: "❌ build issues: ${{ inputs.projects }}"
|
|
||||||
body: "Running log of build failures for ${{ inputs.projects }}"
|
|
||||||
labels: 'build-failure'
|
|
||||||
assignees: 'jhheider'
|
|
||||||
|
|
||||||
- name: Log comment
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
with:
|
|
||||||
actions: 'create-comment'
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
issue-number: ${{ steps.create.outputs.issue-number || fromJSON(steps.find.outputs.issues)[0].number }}
|
|
||||||
body: |
|
|
||||||
# Build failure
|
|
||||||
## ${{ inputs.projects }}
|
|
||||||
### ${{ inputs.platform }}
|
|
||||||
|
|
||||||
logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
||||||
|
|
||||||
- uses: martialonline/workflow-status@v3
|
|
||||||
id: status
|
|
||||||
|
|
||||||
- uses: rtCamp/action-slack-notify@v2
|
|
||||||
if: ${{ env.SLACK_WEBHOOK != '' }}
|
|
||||||
env:
|
|
||||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
|
||||||
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
|
|
||||||
SLACK_MESSAGE: new-version:${{ inputs.projects }} (${{ inputs.platform }}) ${{ steps.status.outputs.status }}
|
|
||||||
SLACK_COLOR: ${{ steps.status.outputs.status }}
|
|
26
.github/workflows/index-data.yml
vendored
26
.github/workflows/index-data.yml
vendored
|
@ -1,26 +0,0 @@
|
||||||
name: index-data
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
projects:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
queue-detail-ingestion:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: teaxyz/setup@v0
|
|
||||||
with:
|
|
||||||
srcroot: null
|
|
||||||
- uses: teaxyz/brewkit/actions/cache@v0
|
|
||||||
# TODO: convert to teaxyz/brewkit/actions/index-packages
|
|
||||||
- run: ./.github/scripts/index-packages.ts ${{ inputs.projects }}
|
|
||||||
env:
|
|
||||||
TEA_PANTRY_PATH: ${{ github.workspace }}
|
|
||||||
AWS_REGION: us-east-1
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
SQS_GENERATE_PACKAGE_DETAILS_URL: ${{ secrets.SQS_GENERATE_PACKAGE_DETAILS_URL }}
|
|
50
.github/workflows/new-version.yml
vendored
50
.github/workflows/new-version.yml
vendored
|
@ -1,5 +1,6 @@
|
||||||
name: new-version
|
name: new-version
|
||||||
run-name: building ${{ inputs.projects }}
|
run-name: building ${{ inputs.projects }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -20,15 +21,54 @@ jobs:
|
||||||
- linux+aarch64
|
- linux+aarch64
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
with:
|
with:
|
||||||
new-version: true
|
|
||||||
projects: ${{ inputs.projects }}
|
projects: ${{ inputs.projects }}
|
||||||
platform: ${{ matrix.platform }}
|
platform: ${{ matrix.platform }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
index_data:
|
bottle:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- darwin+x86-64
|
||||||
|
- linux+x86-64
|
||||||
|
- darwin+aarch64
|
||||||
|
- linux+aarch64
|
||||||
needs: [build]
|
needs: [build]
|
||||||
if: success()
|
uses: ./.github/workflows/bottle.yml
|
||||||
uses: ./.github/workflows/index-data.yml
|
|
||||||
with:
|
with:
|
||||||
projects: ${{ inputs.projects }}
|
new-version: true
|
||||||
|
platform: ${{ matrix.platform }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
complain:
|
||||||
|
needs: [build, bottle]
|
||||||
|
if: failure()
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: ./.github/actions/complain.yml
|
||||||
|
with:
|
||||||
|
projects: ${{ inputs.projects }}
|
||||||
|
platform: ${{ inputs.platform }}
|
||||||
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
slack-channel: ${{ secrets.SLACK_CHANNEL }}
|
||||||
|
|
||||||
|
index_data:
|
||||||
|
needs: [bottle]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: teaxyz/setup@v0
|
||||||
|
with:
|
||||||
|
srcroot: null
|
||||||
|
- uses: teaxyz/brewkit/actions/cache@v0
|
||||||
|
- run: ./.github/scripts/index-packages.ts ${{ inputs.projects }}
|
||||||
|
env:
|
||||||
|
TEA_PANTRY_PATH: ${{ github.workspace }}
|
||||||
|
AWS_REGION: us-east-1
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
SQS_GENERATE_PACKAGE_DETAILS_URL: ${{ secrets.SQS_GENERATE_PACKAGE_DETAILS_URL }}
|
||||||
|
|
Loading…
Reference in a new issue