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

Add update-example-lockfiles workflow #323

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/update-example-lockfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Update example lockfiles
on:
schedule:
# Once per week on Sunday
- cron: "0 0 * * 0"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./
with:
environment-file: ./etc/example-environment-explicit.yml
python-version: "3.9"
- name: Update lockfile
run: |
conda-lock \
--file ./etc/example-environment-explicit.yml \
--platform linux-64 \
--kind explicit \
--filename-template './etc/example-explicit.Linux.conda.lock'
conda-lock \
--file ./etc/example-environment-explicit.yml \
--platform osx-64 \
--kind explicit \
--filename-template './etc/example-explicit.macOS.conda.lock'
conda-lock \
--file ./etc/example-environment-explicit.yml \
--platform win-64 \
--kind explicit \
--filename-template './etc/example-explicit.Windows.conda.lock'
- name: Show changes
run: |
git diff
git status
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "chore(deps): Update example lockfiles"
body: |
This PR updates the example lockfiles to the latest versions of the dependencies.

Please close and re-open the PR to trigger the CI checks / example workflows.
branch-suffix: random
draft: false
add-paths: etc/example-explicit.*.conda.lock
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,10 @@ This means explicitly-defined environments which:
platform/architecture information
- can become broken if any file becomes unavailable

This approach can be useful as part of a larger system e.g., a separate workflow
that runs `conda-lock` for all the platforms needed in a separate job.
This approach can be useful as part of a larger system e.g., a
[separate workflow](https://github.com/conda-incubator/setup-miniconda/actions/workflows/update-example-lockfiles.yml)
that runs `conda-lock` for all the platforms needed in a separate job and
creates update Pull-Requests.

[conda-lock]: https://github.com/conda/conda-lock
[explicit-spec]:
Expand Down
Loading