mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
chore: use reusable tessl update workflow
Replace inline workflow with thin caller to codeflash-ai/github-workflows tessl-update.yml. Move missing tiles list to .tessl/missing-tiles.txt.
This commit is contained in:
parent
c35e026cf8
commit
c172644987
2 changed files with 28 additions and 89 deletions
93
.github/workflows/tessl-update.yml
vendored
93
.github/workflows/tessl-update.yml
vendored
|
|
@ -5,93 +5,8 @@ on:
|
|||
- cron: "0 9 * * 1" # Weekly on Monday at 9am UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
update-tiles:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: tesslio/setup-tessl@v2
|
||||
with:
|
||||
token: ${{ secrets.TESSL_TOKEN }}
|
||||
|
||||
- name: Update existing tiles
|
||||
run: tessl update --yes
|
||||
|
||||
- name: Attempt to install missing tiles
|
||||
run: |
|
||||
workflow_file=".github/workflows/tessl-update.yml"
|
||||
missing_tiles=(
|
||||
tessl/pypi-tree-sitter-javascript
|
||||
tessl/pypi-tree-sitter-typescript
|
||||
tessl/pypi-tree-sitter-java
|
||||
tessl/pypi-tree-sitter-groovy
|
||||
tessl/pypi-tree-sitter-kotlin
|
||||
tessl/pypi-pytest-timeout
|
||||
tessl/pypi-junitparser
|
||||
tessl/pypi-isort
|
||||
tessl/pypi-line-profiler
|
||||
tessl/pypi-pytest-asyncio
|
||||
tessl/pypi-pytest-memray
|
||||
tessl/pypi-unidiff
|
||||
tessl/pypi-ruff
|
||||
tessl/npm-msgpack--msgpack
|
||||
tessl/npm-babel--register
|
||||
tessl/npm-babel--preset-env
|
||||
tessl/maven-com-esotericsoftware--kryo
|
||||
tessl/maven-org-objenesis--objenesis
|
||||
tessl/maven-org-xerial--sqlite-jdbc
|
||||
tessl/maven-org-ow2-asm--asm
|
||||
tessl/maven-org-ow2-asm--asm-commons
|
||||
)
|
||||
installed=()
|
||||
for tile in "${missing_tiles[@]}"; do
|
||||
if tessl install --yes "$tile" 2>&1; then
|
||||
installed+=("$tile")
|
||||
fi
|
||||
done
|
||||
for tile in "${installed[@]}"; do
|
||||
escaped=$(printf '%s\n' "$tile" | sed 's/[/]/\\\//g')
|
||||
sed -i "/^ ${escaped}$/d" "$workflow_file"
|
||||
done
|
||||
if [ ${#installed[@]} -eq ${#missing_tiles[@]} ]; then
|
||||
sed -i '/^ - name: Attempt to install missing tiles$/,/^ - name:/{ /^ - name: Attempt to install missing tiles$/,/^ - name: Check/{ /^ - name: Check/!d; }; }' "$workflow_file" || true
|
||||
fi
|
||||
|
||||
- name: Check for changes
|
||||
id: changes
|
||||
run: |
|
||||
if git diff --quiet && git diff --cached --quiet; then
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Create PR with updates
|
||||
if: steps.changes.outputs.changed == 'true'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
branch="chore/tessl-tile-updates-$(date +%Y%m%d)"
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git checkout -b "$branch"
|
||||
git add tessl.json .tessl/tiles/ .github/workflows/tessl-update.yml
|
||||
git commit -m "chore: update tessl tiles $(date +%Y-%m-%d)"
|
||||
git push origin "$branch"
|
||||
gh pr create \
|
||||
--title "chore: update tessl tiles $(date +%Y-%m-%d)" \
|
||||
--body "$(cat <<'EOF'
|
||||
## Summary
|
||||
|
||||
Automated weekly tessl tile update:
|
||||
- Updated existing tiles to latest versions
|
||||
- Installed newly available tiles for project dependencies
|
||||
|
||||
Generated by the **tessl-update** workflow.
|
||||
EOF
|
||||
)"
|
||||
tessl:
|
||||
uses: codeflash-ai/github-workflows/.github/workflows/tessl-update.yml@main
|
||||
secrets:
|
||||
TESSL_TOKEN: ${{ secrets.TESSL_TOKEN }}
|
||||
|
|
|
|||
24
.tessl/missing-tiles.txt
Normal file
24
.tessl/missing-tiles.txt
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# PyPI
|
||||
tessl/pypi-tree-sitter-javascript
|
||||
tessl/pypi-tree-sitter-typescript
|
||||
tessl/pypi-tree-sitter-java
|
||||
tessl/pypi-tree-sitter-groovy
|
||||
tessl/pypi-tree-sitter-kotlin
|
||||
tessl/pypi-pytest-timeout
|
||||
tessl/pypi-junitparser
|
||||
tessl/pypi-isort
|
||||
tessl/pypi-line-profiler
|
||||
tessl/pypi-pytest-asyncio
|
||||
tessl/pypi-pytest-memray
|
||||
tessl/pypi-unidiff
|
||||
tessl/pypi-ruff
|
||||
# npm
|
||||
tessl/npm-msgpack--msgpack
|
||||
tessl/npm-babel--register
|
||||
tessl/npm-babel--preset-env
|
||||
# Maven
|
||||
tessl/maven-com-esotericsoftware--kryo
|
||||
tessl/maven-org-objenesis--objenesis
|
||||
tessl/maven-org-xerial--sqlite-jdbc
|
||||
tessl/maven-org-ow2-asm--asm
|
||||
tessl/maven-org-ow2-asm--asm-commons
|
||||
Loading…
Reference in a new issue