Skip to content

Commit 6f94028

Browse files
feat: allow setting prs for local testing (#68)
Co-authored-by: Valentin Kharin <[email protected]>
1 parent dc03e6f commit 6f94028

File tree

6 files changed

+362
-118
lines changed

6 files changed

+362
-118
lines changed

.github/workflows/CI.yml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,8 @@ jobs:
3535
cache: true
3636
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
3737

38-
- name: Download pixi artifacts
39-
run: pixi run download-artifacts pixi
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
43-
- name: Download pixi-build-backends artifacts
44-
run: pixi run download-artifacts pixi-build-backends
38+
- name: Download artifacts
39+
run: pixi run download-artifacts
4540
env:
4641
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4742

@@ -74,15 +69,9 @@ jobs:
7469
cache: true
7570
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
7671

77-
- name: Download pixi artifacts
78-
working-directory: ${{ env.PIXI_WORKSPACE }}
79-
run: pixi run download-artifacts pixi
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
83-
- name: Download pixi-build-backends artifacts
72+
- name: Download artifacts
8473
working-directory: ${{ env.PIXI_WORKSPACE }}
85-
run: pixi run download-artifacts pixi-build-backends
74+
run: pixi run download-artifacts
8675
env:
8776
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8877

@@ -106,13 +95,8 @@ jobs:
10695
cache: true
10796
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
10897

109-
- name: Download pixi artifacts
110-
run: pixi run download-artifacts pixi
111-
env:
112-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113-
114-
- name: Download pixi-build-backends artifacts
115-
run: pixi run download-artifacts pixi-build-backends
98+
- name: Download artifacts
99+
run: pixi run download-artifacts
116100
env:
117101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118102

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,23 @@ This repo contains the testsuite that is used by both [Pixi] CI and [pixi-build-
55

66
## Local development
77

8-
First make sure that you have both the [Pixi] and [pixi-build-backends] repositories checked out locally.
8+
The tests can use the pre-built binaries produced by the Pixi and pixi-build-backends CI workflows. Download the latest artifacts for your platform:
99

10-
Then, create a `.env` file at the repository root with the paths to your checked out repositories filled in.
10+
```shell
11+
pixi run download-artifacts
12+
```
13+
14+
The binaries are stored in `artifacts/`, alongside a `download-metadata.json` file that records which branch or PR each artifact originated from. When running locally the script will reuse the active `gh auth` session; if `gh` is unavailable, set `GITHUB_TOKEN` or pass `--token`. Use `--repo pixi` or `--repo pixi-build-backends` to fetch artifacts for a single project.
15+
16+
With the artifacts in place you can run the fast subset of the tests (or any other Pixi task):
17+
18+
```shell
19+
pixi run test
20+
```
21+
22+
### Using local builds instead of artifacts
23+
24+
If you prefer to use local checkouts, create a `.env` file with the paths to your repositories:
1125

1226
```shell
1327
PIXI_REPO="/path/to/pixi-repository"
@@ -17,37 +31,28 @@ PIXI_BIN_DIR="${PIXI_REPO}/target/pixi/release"
1731
BUILD_BACKENDS_BIN_DIR="${BUILD_BACKENDS_REPO}/target/pixi/release"
1832
```
1933

20-
You can build the executables by running the following Pixi task.
21-
It will also make sure that your repositories are up-to-date:
34+
Then build the binaries with:
2235

2336
```shell
2437
pixi run build-repos
2538
```
2639

27-
Finally, you can run the fast subset of the tests with the following task.
28-
Also, check out the other Pixi tasks to run more tests on your local machine:
29-
30-
```shell
31-
pixi run test
32-
```
33-
34-
## Testing PR combinations in CI
40+
## Testing PR combinations
3541

3642
To test a combination of PRs from this testsuite with PRs from [Pixi] or [pixi-build-backends]:
3743

38-
1. Create a `.env.ci` file with PR numbers:
44+
1. Create a `.env.ci` or modify your local `.env` file with PR numbers:
3945
```shell
4046
# Test with specific PR from pixi repository
4147
PIXI_PR_NUMBER="123"
42-
43-
# Test with specific PR from pixi-build-backends repository
48+
49+
# Test with specific PR from pixi-build-backends repository
4450
BUILD_BACKENDS_PR_NUMBER="456"
4551
```
46-
2. The CI will download artifacts from these PRs instead of main branch
52+
2. `pixi run download-artifacts` (locally or in CI) will download artifacts from these PRs instead of main
4753
3. **Important**: Remove `.env.ci` before merging to main (CI will prevent merge if present)
4854

4955
This allows you to test how your testsuite changes work with specific PRs from the other repositories.
5056

51-
5257
[Pixi]: https://github.com/prefix-dev/pixi
5358
[pixi-build-backends]: https://github.com/prefix-dev/pixi-build-backends

examples/build-recipe/pixi.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)