Skip to content

Commit

Permalink
mkblockers
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Oct 29, 2024
1 parent ef83a20 commit a8c5af6
Show file tree
Hide file tree
Showing 5 changed files with 765 additions and 220 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/check-blockers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update Blockers Meta

on:
push:
paths:
- 'blockers/list.json'
- '*.go'
- '.github/workflows/update-blockers.yml'
pull_request:
branches:
- master

jobs:
check_blockers:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.19
- uses: actions/checkout@v4
- name: Create local changes
run: |
go build
./main -target blockers
- name: set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pipenv'
- name: install dependencies
run: |
python -m pip install --upgrade pipenv wheel
pipenv install --deploy
- name: run mkblockers
run: |
jq --sort-keys --indent 2 < blockers.json >blockers-sorted.json
pipenv run ./mkblockers
if ! (cmp -s blockers-sorted.json blockers-new.json); then
echo "Error: output from mkblockers differs from legacy blockers builder."
diff -u blockers-sorted.json blockers-new.json
exit 1
fi
32 changes: 31 additions & 1 deletion .github/workflows/update-blockers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,36 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

run-mkblockers:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pipenv'
- name: install dependencies
run: |
python -m pip install --upgrade pipenv wheel
pipenv install --deploy
- name: run mkblockers
run: |
jq --sort-keys --indent 2 < blockers.json >blockers-sorted.json
pipenv run ./mkblockers
if ! (cmp -s blockers-sorted.json blockers-new.json); then
echo "Error: output from mkblockers differs from legacy blockers builder."
diff -u blockers-sorted.json blockers-new.json
exit 1
fi
invalidate-cache:
runs-on: ubuntu-latest
if: |
Expand All @@ -52,4 +82,4 @@ jobs:
run: echo "version=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Invalidate cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/${{ env.version }}/blockers.json"
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/${{ env.version }}/blockers.json"
6 changes: 4 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[packages]
pyyaml = "6.0.1"
jsonschema = "4.21.1"
requests = "2.31.0"
requests = "2.32.3"
PyGithub = "2.4.0"

[dev-packages]
black = "24.10.0"

[requires]
python_version = "*"
python_version = "3.12"
Loading

0 comments on commit a8c5af6

Please sign in to comment.