Skip to content

Commit 88d2cd0

Browse files
committed
refactor(tests): run against the last release of the revdep target.
Signed-off-by: Brian Harring <[email protected]>
1 parent 3089570 commit 88d2cd0

File tree

1 file changed

+22
-41
lines changed

1 file changed

+22
-41
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -85,55 +85,36 @@ jobs:
8585
with:
8686
files: ./coverage.xml
8787

88-
pkgcheck-test:
88+
revdep:
8989
runs-on: ubuntu-latest
90+
strategy:
91+
matrix:
92+
repo: ['pkgcheck', 'pkgdev']
9093
steps:
9194
- name: Checkout pkgcore
9295
uses: pkgcore/gh-actions/get-source@main
9396
with:
9497
artifact-id: ${{ inputs.release-artifact-id }}
9598
path: pkgcore
9699

97-
- name: Checkout pkgcheck
98-
uses: actions/checkout@v5
99-
with:
100-
repository: pkgcore/pkgcheck
101-
path: pkgcheck
102-
103-
- name: Set up Python 3.13
104-
uses: actions/setup-python@v5
105-
with:
106-
python-version: '3.13'
107-
cache: 'pip'
108-
cache-dependency-path: |
109-
pkgcore/pyproject.toml
110-
pkgcheck/pyproject.toml
111-
112-
- name: Install pip dependencies
100+
- name: Find last ${{ matrix.repo }} release
113101
run: |
114-
python -m pip install --upgrade pip
115-
pip install "./pkgcore"
116-
pip install "./pkgcheck[test]"
117-
118-
- name: Test with pytest
119-
working-directory: ./pkgcheck
120-
env:
121-
PY_COLORS: 1 # forcibly enable pytest colors
122-
run: pytest -v
123-
124-
pkgdev-test:
125-
runs-on: ubuntu-latest
126-
steps:
127-
- name: Checkout pkgcore
128-
uses: pkgcore/gh-actions/get-source@main
129-
with:
130-
artifact-id: ${{ inputs.release-artifact-id }}
131-
path: pkgcore
132-
- name: Checkout pkgdev
102+
versions=$(git ls-remote -q --refs https://github.com/pkgcore/${{ matrix.repo }} | \
103+
sed -nre 's:.*refs/tags/(.+)$:\1:p' | \
104+
sort -V)
105+
echo found versions:
106+
echo "${versions}"
107+
latest=$(echo "$versions" | tail -n 1)
108+
echo "latest=${latest}"
109+
[ -z "$latest" ] && { echo "failed finding the tag"; exit 1; }
110+
echo "LATEST_TAG=$latest" >> $GITHUB_ENV
111+
112+
- name: Checkout ${{ matrix.repo }} ${{ env.LATEST_TAG }}
133113
uses: actions/checkout@v5
134114
with:
135-
repository: pkgcore/pkgdev
136-
path: pkgdev
115+
repository: pkgcore/pkgcheck
116+
path: ${{ matrix.repo }}
117+
ref: ${{ env.LATEST_TAG }}
137118

138119
- name: Set up Python 3.13
139120
uses: actions/setup-python@v5
@@ -142,16 +123,16 @@ jobs:
142123
cache: 'pip'
143124
cache-dependency-path: |
144125
pkgcore/pyproject.toml
145-
pkgdev/pyproject.toml
126+
${{ matrix.repo }}/pyproject.toml
146127
147128
- name: Install pip dependencies
148129
run: |
149130
python -m pip install --upgrade pip
150131
pip install "./pkgcore"
151-
pip install "./pkgdev[test]"
132+
pip install "./${{ matrix.repo }}[test]"
152133
153134
- name: Test with pytest
154-
working-directory: ./pkgdev
135+
working-directory: ./${{ matrix.repo }}
155136
env:
156137
PY_COLORS: 1 # forcibly enable pytest colors
157138
run: pytest -v

0 commit comments

Comments
 (0)