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

FIX: Use $GITHUB_ACTION_PATH to locate pixi.lock for downstream users #96

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

MridulS
Copy link
Member

@MridulS MridulS commented Sep 30, 2024

I'm not sure, but I think with the change to composite action we need to also be specific about this repo's filepaths by using GITHUB_ACTION_PATH . I tried to use 0.6.0 downstream and I got an error `Failed to generate cache key: Error: ENOENT: no such file or directory, open 'pixi.lock'

Squash and merge commit message

* As the GitHub Action is being used in other workflows, it does not know the
  local filepaths and so to have prefix-dev/setup-pixi find the lock file and
  'pixi run' know where `upload_wheels.sh` is, the environmental variable
  'GITHUB_ACTION_PATH' is used through the ${{ github.action_path }} context.
   - c.f. https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables

I'm not sure, but I think with the change to composite action we need to also be specific about this repo's filepaths by using `GITHUB_ACTION_PATH` . I tried to use `0.6.0` downstream and I got an error `Failed to generate cache key: Error: ENOENT: no such file or directory, open 'pixi.lock'
@matthewfeickert
Copy link
Member

Can you link to the failure downstream? If it is complaining about the lock file that seems different.

@MridulS
Copy link
Member Author

MridulS commented Sep 30, 2024

Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MridulS To see if this actually works could you (momentarily and then revert it) switch in the CI the local action path

to use your fork's MridulS-patch-1 branch?

edit: Ah, sorry I see that this is a branch on the main repo. I just misread your branch name. Let me try this quickly using my fork and your changes on a different branch.

action.yml Outdated Show resolved Hide resolved
Co-authored-by: Matthew Feickert <matthew.feickert@cern.ch>
@matthewfeickert
Copy link
Member

@MridulS Okay, yes that works. Thank you!

What I did to test was to push your MridulS-patch-1 branch to my fork

$ git branch --all | grep patch
  MridulS-patch-1
* debug-ci-with-mriduls-patch
  matthewfeickert/MridulS-patch-1
  remotes/matthewfeickert/MridulS-patch-1
  remotes/origin/MridulS-patch-1
  remotes/origin/debug-ci-with-mriduls-patch

and then run the CI manually on another branch using my fork as the target

$ git branch
  MridulS-patch-1
* debug-ci-with-mriduls-patch
  main
  matthewfeickert/MridulS-patch-1
$ git diff origin/main 
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cdd4d13..19d0427 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -48,13 +48,13 @@ jobs:
         run: python -m zipfile --list dist/test_package-*.whl
 
       - name: Test upload
-        uses: ./
+        uses: matthewfeickert/upload-nightly-action@MridulS-patch-1
         with:
           artifacts_path: dist
           anaconda_nightly_upload_token: ${{ secrets.UPLOAD_TOKEN }}
 
       - name: Test upload that forces removal first
-        uses: ./
+        uses: matthewfeickert/upload-nightly-action@MridulS-patch-1
         with:
           artifacts_path: dist
           anaconda_nightly_upload_token: ${{ secrets.UPLOAD_TOKEN }}
@@ -67,7 +67,7 @@ jobs:
           python -m build --outdir ./dist tests/test_package
 
       - name: Test upload with non-main label
-        uses: ./
+        uses: matthewfeickert/upload-nightly-action@MridulS-patch-1
         with:
           artifacts_path: dist
           anaconda_nightly_upload_token: ${{ secrets.UPLOAD_TOKEN }}
@@ -81,7 +81,7 @@ jobs:
           python -m build --outdir ./dist tests/test_package
 
       - name: Test upload with multiple labels
-        uses: ./
+        uses: matthewfeickert/upload-nightly-action@MridulS-patch-1
         with:
           artifacts_path: dist
           anaconda_nightly_upload_token: ${{ secrets.UPLOAD_TOKEN }}

That works. 👍

We need better testing though apparently.

I'm going to write some longer squash and merge commit message and then I'll merge this and get a patch release out.

@matthewfeickert matthewfeickert changed the title MAINT: Use $GITHUB_ACTION_PATH to locate pixi.lock for downstream users FIX: Use $GITHUB_ACTION_PATH to locate pixi.lock for downstream users Sep 30, 2024
@matthewfeickert matthewfeickert added the fix fixes a bug label Sep 30, 2024
@matthewfeickert matthewfeickert merged commit 40829e9 into main Sep 30, 2024
2 checks passed
@matthewfeickert matthewfeickert deleted the MridulS-patch-1 branch September 30, 2024 15:29
@MridulS
Copy link
Member Author

MridulS commented Sep 30, 2024

Thanks @matthewfeickert!

We need better testing though apparently.

Testing actions inside actions are tricky anyway.

I think it's still not done yet! We need to add --manifest-path to pixi run too! (finding new edges for pixi :) )

MridulS added a commit that referenced this pull request Sep 30, 2024
I missed this in #96 but we need to be explicit while using `pixi run` too.

I was tripping into `could not find pixi.toml or pyproject.toml which is configured to use pixi` while on the `pixi run` step downstream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants