-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Cache venv * Cache venv * Fix test * Fix checksum step * Don't have trailing hyphen if no dependency specified * Fix syntax * Fix syntax for real * Try quotes * Try echoing * split up steps * Fix * Try single quote * Use yaml thing that removes newlines * Use shasum * Use Python * Fix output syntax * Missing quote * Sort and formatting * Bump setup-python version --------- Co-authored-by: Jay Qi <[email protected]>
- Loading branch information
Showing
4 changed files
with
248 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
name: benchmarks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tests-cache-packages: | ||
name: Test uv, cache packages (${{ matrix.os }}, Python ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.12"] | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python with uv (local source) | ||
uses: ./ | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: packages | ||
cache-dependency-path: >- | ||
test_assets/requirements.txt | ||
- name: Check active Python | ||
run: | | ||
echo "Python: $(which python)" | ||
echo "Python version: $(python --version)" | ||
- name: Install dependencies | ||
run: | | ||
uv pip install -r test_assets/requirements.txt | ||
- name: Test some stuff | ||
run: | | ||
python -c "import cloudpathlib; print('cloudpathlib:', cloudpathlib.__version__)" | ||
nbautoexport --version | ||
mkdocs --version | ||
pytest --version | ||
tests-cache-venv: | ||
name: Test uv, cache venv (${{ matrix.os }}, Python ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.12"] | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python with uv (local source) | ||
uses: ./ | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: venv | ||
cache-dependency-path: >- | ||
test_assets/requirements.txt | ||
- name: Check active Python | ||
run: | | ||
echo "Python: $(which python)" | ||
echo "Python version: $(python --version)" | ||
- name: Install dependencies | ||
run: | | ||
uv pip install -r test_assets/requirements.txt | ||
- name: Test some stuff | ||
run: | | ||
python -c "import cloudpathlib; print('cloudpathlib:', cloudpathlib.__version__)" | ||
nbautoexport --version | ||
mkdocs --version | ||
pytest --version | ||
tests-no-cache: | ||
name: Test uv no cache (${{ matrix.os }}, Python ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.12"] | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python with uv (local source) | ||
uses: ./ | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Check active Python | ||
run: | | ||
echo "Python: $(which python)" | ||
echo "Python version: $(python --version)" | ||
- name: Install dependencies | ||
run: | | ||
uv pip install -r test_assets/requirements.txt | ||
- name: Test some stuff | ||
run: | | ||
python -c "import cloudpathlib; print('cloudpathlib:', cloudpathlib.__version__)" | ||
nbautoexport --version | ||
mkdocs --version | ||
pytest --version | ||
tests-pip-cache: | ||
name: Test pip, cache (${{ matrix.os }}, Python ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.12"] | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
cache-dependency-path: >- | ||
test_assets/requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
pip install -r test_assets/requirements.txt | ||
- name: Test some stuff | ||
run: | | ||
python -c "import cloudpathlib; print('cloudpathlib:', cloudpathlib.__version__)" | ||
nbautoexport --version | ||
mkdocs --version | ||
pytest --version | ||
tests-pip-no-cache: | ||
name: Test pip, no cache (${{ matrix.os }}, Python ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.12"] | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r test_assets/requirements.txt | ||
- name: Test some stuff | ||
run: | | ||
python -c "import cloudpathlib; print('cloudpathlib:', cloudpathlib.__version__)" | ||
nbautoexport --version | ||
mkdocs --version | ||
pytest --version | ||
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import hashlib | ||
from pathlib import Path | ||
import sys | ||
import textwrap | ||
|
||
def main(): | ||
dep_checksums = [] | ||
for dep in sorted(sys.argv[1:]): | ||
# In general, dep is a glob | ||
for path in sorted(Path().glob(dep)): | ||
dep_checksums.append((path, hashlib.md5(path.read_bytes()).hexdigest())) | ||
dep_checksums_str = textwrap.indent( | ||
"\n".join([f"{path} {checksum}" for path, checksum in dep_checksums]), | ||
" " | ||
) | ||
sys.stderr.write(f"Dependency checksums:\n{dep_checksums_str}\n") | ||
overall_checksum = hashlib.md5(dep_checksums_str.encode()).hexdigest() | ||
sys.stderr.write(f"Overall checksum: {overall_checksum}\n") | ||
sys.stdout.write(overall_checksum) | ||
|
||
if __name__ == "__main__": | ||
main() |