-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (93 loc) · 3.2 KB
/
Copy pathtest.yml
File metadata and controls
105 lines (93 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Self-test. Runs the action against test/fixture with dry_run: true, so it
# exercises every step — including the real rattler-build conda build — without
# uploading anything.
#
# Run this green before moving the v1 tag. Consumers are pinned to a moving
# major tag, so a bad push breaks all of them at once.
name: Test
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
full:
# PyPI + conda path, on both runner families, which is what validates the
# per-target rattler-build download the README promises.
name: Full dry run (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v5
- id: publish
uses: ./
with:
project_dir: test/fixture
test: pytest
python_versions: auto
version_module: test/fixture/src/fixture_pkg/__init__.py
# Only decides that the conda package gets built. dry_run means the
# upload step never runs, so this value is never used as a channel.
anaconda_owner: fixture-never-uploaded
dry_run: true
- name: Check the version output
shell: bash
env:
VERSION: ${{ steps.publish.outputs.version }}
run: |
test "$VERSION" = "0.1.0" || {
echo "::error::expected version output 0.1.0, got '$VERSION'"
exit 1
}
- name: Check a noarch conda package was produced
shell: bash
run: |
set -euo pipefail
found="$(find test/fixture/.conda-build/out -type f -name '*.conda' | head -n1)"
test -n "$found" || { echo "::error::no .conda package built"; exit 1; }
case "$found" in
*/noarch/*) echo "noarch package: $found" ;;
*) echo "::error::expected a noarch package, got $found"; exit 1 ;;
esac
pypi_only:
# No anaconda_owner: conda is skipped entirely and rattler-build must never
# be downloaded.
name: PyPI-only dry run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./
with:
project_dir: test/fixture
test: pytest
dry_run: true
- name: Check conda was skipped
shell: bash
run: |
if [ -d test/fixture/.conda-build ]; then
echo "::error::conda ran despite anaconda_owner being empty"
exit 1
fi
if command -v rattler-build >/dev/null 2>&1; then
echo "::error::rattler-build was installed despite conda being skipped"
exit 1
fi
echo "conda correctly skipped"
generated:
# The generated-project path: `prepare` synthesizes the project that
# `project_dir` points at. This is how stub-only distributions are shipped.
name: Generated project dry run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./
with:
prepare: mkdir -p .generated && cp -r test/fixture/. .generated/
project_dir: .generated
anaconda_owner: fixture-never-uploaded
dry_run: true