diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 4398dd7..144be10 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -1,27 +1,46 @@ name: Run pipeline -on: push +on: + push: + branches: + - main + pull_request: permissions: contents: write +# Make sure we only ever run one per branch so we don't have issues pushing +# after running the pipeline +concurrency: + group: calkit-run-${{ github.ref }} + cancel-in-progress: false + jobs: main: name: Run runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + # For PRs, checkout the head ref to avoid detached HEAD + ref: ${{ github.head_ref || github.ref_name }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Configure Git credentials run: | git config user.name github-actions[bot] git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Setup uv + uses: astral-sh/setup-uv@v5 - name: Setup Miniforge uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest auto-activate-base: true conda-remove-defaults: true - - run: pip install calkit-python + - name: Install Calkit + run: uv tool install calkit-python - name: Restore DVC cache id: cache-dvc-restore uses: actions/cache/restore@v4 @@ -33,8 +52,9 @@ jobs: - run: calkit config remote-auth env: CALKIT_DVC_TOKEN: ${{ secrets.CALKIT_DVC_TOKEN }} - - run: dvc pull + - run: calkit dvc pull - run: calkit run + # If running on a PR, push to that branch, else push to main - run: calkit save -am "Run pipeline" env: CALKIT_DVC_TOKEN: ${{ secrets.CALKIT_DVC_TOKEN }} diff --git a/dvc.lock b/dvc.lock index 4f2c464..4280a37 100644 --- a/dvc.lock +++ b/dvc.lock @@ -65,13 +65,13 @@ stages: nfiles: 2 - path: paper/paper.tex hash: md5 - md5: 1480301e18c57bf533d604e1a3593101 - size: 653 + md5: 09f2923d7ec5a75fefe95497d6e177cd + size: 678 outs: - path: paper/paper.pdf hash: md5 - md5: 13ee8eb76f777de6242c16c15d054673 - size: 94915 + md5: bff1721a57af4275b13af9dd8033ad9a + size: 95417 _check_env_py: cmd: calkit check conda-env --file environment.yml --output .calkit/env-locks/py.yml diff --git a/paper/paper.tex b/paper/paper.tex index 7790868..eb6bd3a 100644 --- a/paper/paper.tex +++ b/paper/paper.tex @@ -40,6 +40,8 @@ \section{Section 2} This is another sentence in the second section. +This was added in a PR. + %--/Paper-- \end{document}