diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml new file mode 100644 index 0000000..240dcff --- /dev/null +++ b/.github/workflows/regression.yml @@ -0,0 +1,46 @@ +name: Regression + +on: + workflow_dispatch: + +jobs: + main: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y curl + sudo apt install -y gcc-9 gcc-10 gcc-11 gcc-12 + + - name: Install CWhy + run: | + python3 -m pip install --upgrade pip + python3 -m pip install . + + - name: Generate current prompts + run: python3 tests/regression.py --platform ubuntu --generate + + - name: Commit + run: | + git diff | test # There are no changes to the prompts. + git config user.name github-actions + git config user.email github-actions@github.com + git add tests/.regression + git switch -c bot/regression/ubuntu + git commit -m "[bot] Generate current state of CWhy prompts" + git push origin --delete bot/regression/ubuntu + git push origin bot/regression/ubuntu + + - name: Create pull request + run: | + 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/plasma-umass/cwhy/pulls \ + -d '{"title":"[bot] Generate current state of CWhy prompts","body":"Timestamp: ${{github.event.repository.updated_at}}","head":"bot/regression/ubuntu","base":"main"}'