Refresh BetterTLS testcases #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Refresh BetterTLS testcases | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- ww/bettertls | |
schedule: | |
# tuesday every other month at 5PM UTC | |
- cron: "0 17 * */2 2" | |
jobs: | |
refresh: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # for branch creation | |
pull-requests: write # for PR creation | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ">=3.11" | |
cache: "pip" | |
cache-dependency-path: pyproject.toml | |
- name: Check out BetterTLS | |
uses: actions/checkout@v4 | |
with: | |
repository: Netflix/bettertls | |
ref: master | |
path: bettertls | |
- name: Build BetterTLS JSON | |
run: | | |
go build -C bettertls/test-suites/cmd/bettertls/ -o /tmp/bettertls | |
/tmp/bettertls export-tests | jq . > /tmp/bettertls.json | |
if [[ -f limbo/_assets/bettertls.json ]]; then | |
# Only update if the betterTlsRevision has changed | |
old_revision=$(jq -r .betterTlsRevision limbo/_assets/bettertls.json) | |
new_revision=$(jq -r .betterTlsRevision /tmp/bettertls.json) | |
if [[ "${old_revision}" != "${new_revision}" ]]; then | |
mv /tmp/bettertls.json limbo/_assets/bettertls.json | |
else | |
echo "::notice::BetterTLS did not change, not updating" | |
fi | |
else | |
mv /tmp/bettertls.json limbo/_assets/bettertls.json | |
fi | |
- name: create PR | |
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 | |
with: | |
commit-message: "[BOT] update BetterTLS testcases" | |
branch: update-BetterTLS-testcases | |
branch-suffix: timestamp | |
title: "[BOT] update BetterTLS testcases" | |
body: | | |
This is an automated pull request, updating the cached BetterTLS testcases | |
in Limbo. | |
Please review manually before merging. | |
add-paths: limbo/_assets/bettertls.json | |
assignees: "woodruffw" | |
reviewers: "woodruffw" |