Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache Python Packages in the CI pipeline #4488

Merged
23 changes: 21 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ jobs:
with:
python-version: ${{ env.min-python-version }}

- name: Set Date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
shell: bash
waynehamadi marked this conversation as resolved.
Show resolved Hide resolved

- name: Cache Python packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ env.DATE }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -112,6 +122,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set Date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
shell: bash
waynehamadi marked this conversation as resolved.
Show resolved Hide resolved

- name: Cache Python packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ env.DATE }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -138,7 +158,7 @@ jobs:
git config --global user.email "github-bot@agpt.co"
git add tests/integration/challenges/current_score.json

if ! git diff-index --quiet HEAD; then
if ! git diff --quiet -- tests/integration/challenges/current_score.json; then
git commit -m "Update current score"
git push origin HEAD:refs/heads/$current_branch
else
Expand All @@ -162,7 +182,6 @@ jobs:
git push origin HEAD:refs/heads/$current_branch
else
echo "No cassettes changes to commit"
exit 0
fi

- name: Update cassette submodule to submodule branch if PR event
Expand Down
6 changes: 1 addition & 5 deletions tests/integration/challenges/current_score.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
"information_retrieval_challenge_a": {
"max_level": 3,
"max_level_beaten": 1
},
"information_retrieval_challenge_b": {
"max_level": 1,
"max_level_beaten": 1
}
},
"kubernetes": {
Expand All @@ -45,4 +41,4 @@
"max_level_beaten": 1
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
CYCLE_COUNT = 3


@pytest.mark.skip(
"This test uses the browse website functionality, which VCR doesn't support yet, this means it's slower, costs money and is less reliable. It will be unskipped once VCR support browse_website"
)
waynehamadi marked this conversation as resolved.
Show resolved Hide resolved
@pytest.mark.vcr
@requires_api_key("OPENAI_API_KEY")
@challenge
Expand Down