From ef3e4597c9dfbc43fef907ccb2625c39ba4eefb5 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 25 Jun 2024 08:51:56 -0400 Subject: [PATCH] Test update-conda-lockfiles --- .github/workflows/test.yaml | 8 ++++++++ test/update-conda-lockfile/environment.yaml | 4 ++++ test/update-conda-lockfile/update-lockfiles.sh | 12 ++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 test/update-conda-lockfile/environment.yaml create mode 100755 test/update-conda-lockfile/update-lockfiles.sh diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0f1e6e5..a5f2e04 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -78,6 +78,13 @@ jobs: uses: ./setup-cargo-bundle-licenses - run: cargo bundle-licenses --version + update_conda_lockfiles: + if: ${{ github.ref_name != 'update-conda-lockfiles' }} + uses: .github/workflows/update-conda-lockfiles.yaml + with: + branch: ${{ github.ref_name }} + path: test/update-conda-lockfile + tests_complete: name: All tests if: always() @@ -87,6 +94,7 @@ jobs: - setup_uv_lockfile - setup_mdbook - setup_cargo_bundle_licenses + - update_conda_lockfiles runs-on: ubuntu-latest steps: diff --git a/test/update-conda-lockfile/environment.yaml b/test/update-conda-lockfile/environment.yaml new file mode 100644 index 0000000..707fe06 --- /dev/null +++ b/test/update-conda-lockfile/environment.yaml @@ -0,0 +1,4 @@ +channels: +- conda-forge +dependencies: +- python==3.12 diff --git a/test/update-conda-lockfile/update-lockfiles.sh b/test/update-conda-lockfile/update-lockfiles.sh new file mode 100755 index 0000000..4e18b19 --- /dev/null +++ b/test/update-conda-lockfile/update-lockfiles.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Execute this script to update all lock files to the latest versions of dependencies. + +rm *-conda-lock.yml + +for python_version in 3.12 +do + sed "s/python==.*/python=$python_version/g" environment.yaml > tmp.yaml || exit 2 + conda lock -f tmp.yaml -p osx-arm64 -p osx-64 -p linux-64 --lockfile py${python_version//.}-conda-lock.yml || exit 2 +done +rm tmp.yaml