Skip to content

Commit

Permalink
Switch back to triggering on environment changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneselvans committed Nov 6, 2023
1 parent e075db5 commit 97185cf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 58 deletions.
73 changes: 29 additions & 44 deletions .github/workflows/update-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,52 @@ on:
# - cron: "0 9 * * 1-5" # Weekdays at 9AM UTC
pull_request:
paths:
- "test_gha.txt"
- "pyproject.toml"
- "environments/*"
branches:
- dev
- main

jobs:
cat-test-file:
conda-lock:
runs-on: ubuntu-latest
if: github.actor != 'pudlbot'
#if: (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name != 'schedule')
# If running on a pull_request because of file changes:
# - Relock and commit changes directly to the branch
# - Don't trigger the action a 2nd time when run by pudlbot
if: (github.actor != 'pudlbot' && github.event_name == 'pull_request')
defaults:
run:
shell: bash -l {0}
permissions:
contents: write

steps:
- name: Checkout PUDL source code
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
token: ${{ secrets.PUDL_BOT_PAT }}
- name: Cat the changed file and save its new hash.
- name: Install Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: conda-lock
create-args: >-
python=3.11
conda-lock
prettier
- name: Run conda-lock to recreate lockfile from scratch
run: |
cat test_gha.txt
echo `date --iso-8601=seconds` `sha256sum test_gha.txt` >> hashlog
cat hashlog
echo "Event Name:" ${{ github.event_name }}
echo "Actor:" ${{ github.actor }}
cat ${{ github.event_path }}
- name: Commit changed hashlog
make conda-clean
make conda-lock.yml
- name: Commit updated conda lockfiles
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "*hashlog*"

# conda-lock:
# # Don't run scheduled job on forks.
# # if: (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name != 'schedule')
# defaults:
# run:
# shell: bash -l {0}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# # If running on a schedule, run on dev.
# # If running from workflow_dispatch, run on whatever the chosen branch/ref was.
# # with:
# # ref: dev
# - name: Install Micromamba
# uses: mamba-org/setup-micromamba@v1
# with:
# environment-name: conda-lock
# create-args: >-
# python=3.11
# conda-lock
# prettier
file_pattern: "environments/*"

# - name: Run conda-lock to recreate lockfile from scratch
# run: |
# make conda-lock
# If running on workflow_dispatch:
# - make a PR rather than committing directly to the branch.
# - run on whatever branch you were directed to run on.

# # TODO: Make this step require the success of the the previous make conda-lock step
# If running on a schedule:
# - make a PR rather that committing directly to the branch.
# - always run against dev.
# - don't run if on forks.
# if: (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name != 'schedule')
# - name: Open a pull request
# uses: peter-evans/create-pull-request@v5
# with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
"numpy>=1.24,<2.0a0",
"openpyxl>=3.0.10", # pandas[excel]
"pandas>=2.1",
"pandera-base>=0.17.2",
"pandera>=0.17.2",
"pyarrow>=13", # pandas[parquet]
"pydantic>=1.10,<2",
#"pydantic>=2.4",
Expand Down
13 changes: 0 additions & 13 deletions test_gha.txt

This file was deleted.

0 comments on commit 97185cf

Please sign in to comment.