measure thinking tokens #3916
This file contains hidden or 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: Run coopr - edsl tests | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - '**' | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| if: ${{ github.event_name == 'push' && contains(github.event.head_commit.message, 'coopr') || github.event_name == 'pull_request' }} | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Determine last commit hash | |
| id: get_last_commit | |
| run: | | |
| if [ "${{ github.head_ref }}" != "" ]; then | |
| # Pull Request: Get the last commit from the source branch | |
| echo "COMMIT=$(git rev-parse ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV | |
| else | |
| # Push: Get the last commit directly | |
| echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
| fi | |
| - name: Update pyproject.toml for EDSL target commit | |
| run: | | |
| cd /home/stefan/expectedparrot/coopr/backend | |
| git checkout -f new_job_runner | |
| git fetch origin | |
| git pull | |
| sed -i -E "s|edsl = \{git = \"https://github.com/expectedparrot/edsl.git\", rev = \".*\"\}|edsl = {git = \"https://github.com/expectedparrot/edsl.git\", rev = \"$COMMIT\"}|" pyproject.toml | |
| sed -i -E "s|edsl = \{git = \"https://github.com/expectedparrot/edsl.git\",branch = \".*\"\}|edsl = {git = \"https://github.com/expectedparrot/edsl.git\", rev = \"$COMMIT\"}|" pyproject.toml | |
| source /home/stefan/expectedparrot/coopr/backend/project/bin/activate | |
| poetry lock | |
| - name: Run Docker Compose | |
| run: | | |
| cd /home/stefan/expectedparrot/coopr | |
| docker compose up --build --wait | |
| - name: Fetch and checkout last commit in EDSL | |
| run: | | |
| cd /home/stefan/expectedparrot/edsl | |
| git fetch origin | |
| git checkout -f $COMMIT || git checkout -f origin/main # Fallback to main if commit is unavailable | |
| - name: Run make coop-test | |
| run: | | |
| cd /home/stefan/expectedparrot/edsl | |
| source ./project/bin/activate | |
| poetry install | |
| make test-coop |