Skip to content

Commit 9d888d2

Browse files
CI: Use a non-default path to run the upload action (#100)
* Don't rely on the action's '$GITHUB_ACTION_PATH' variable being the current directory during testing.
1 parent 513d82a commit 9d888d2

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
25+
# Don't rely on the action's path being in the current directory
26+
with:
27+
path: '_action_path'
2528

2629
- name: Set up Python
2730
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
@@ -36,7 +39,7 @@ jobs:
3639
3740
- name: Build v0.0.1 wheel and sdist
3841
run: |
39-
python -m build --outdir ./dist tests/test_package
42+
python -m build --outdir ./dist _action_path/tests/test_package
4043
4144
- name: Verify the distribution
4245
run: twine check --strict dist/*
@@ -48,26 +51,26 @@ jobs:
4851
run: python -m zipfile --list dist/test_package-*.whl
4952

5053
- name: Test upload
51-
uses: ./
54+
uses: ./_action_path/
5255
with:
5356
artifacts_path: dist
5457
anaconda_nightly_upload_token: ${{ secrets.UPLOAD_TOKEN }}
5558

5659
- name: Test upload that forces removal first
57-
uses: ./
60+
uses: ./_action_path/
5861
with:
5962
artifacts_path: dist
6063
anaconda_nightly_upload_token: ${{ secrets.UPLOAD_TOKEN }}
6164

6265
- name: Build v0.0.2 wheel and sdist
6366
run: |
6467
# Bump version to avoid wheel name conflicts
65-
sed -i 's/0.0.1/0.0.2/g' tests/test_package/pyproject.toml
68+
sed -i 's/0.0.1/0.0.2/g' _action_path/tests/test_package/pyproject.toml
6669
rm ./dist/*
67-
python -m build --outdir ./dist tests/test_package
70+
python -m build --outdir ./dist _action_path/tests/test_package
6871
6972
- name: Test upload with non-main label
70-
uses: ./
73+
uses: ./_action_path/
7174
with:
7275
artifacts_path: dist
7376
anaconda_nightly_upload_token: ${{ secrets.UPLOAD_TOKEN }}
@@ -76,12 +79,12 @@ jobs:
7679
- name: Build v0.0.3 wheel and sdist
7780
run: |
7881
# Bump version to avoid wheel name conflicts
79-
sed -i 's/0.0.2/0.0.3/g' tests/test_package/pyproject.toml
82+
sed -i 's/0.0.2/0.0.3/g' _action_path/tests/test_package/pyproject.toml
8083
rm ./dist/*
81-
python -m build --outdir ./dist tests/test_package
84+
python -m build --outdir ./dist _action_path/tests/test_package
8285
8386
- name: Test upload with multiple labels
84-
uses: ./
87+
uses: ./_action_path/
8588
with:
8689
artifacts_path: dist
8790
anaconda_nightly_upload_token: ${{ secrets.UPLOAD_TOKEN }}

0 commit comments

Comments
 (0)