Skip to content

Commit d320e6c

Browse files
committed
add new testing pipeline
1 parent 4b188df commit d320e6c

2 files changed

Lines changed: 118 additions & 21 deletions

File tree

.github/workflows/ci-test.yaml

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,42 @@ jobs:
2121
matrix:
2222
task: ${{ fromJSON(inputs.config).tasks }}
2323
runs-on: ${{ matrix.task.runner }}
24+
defaults:
25+
run:
26+
shell: bash -el {0}
2427
steps:
28+
- name: uname
29+
run: uname -a
2530
- name: Repository Checkout
26-
if: (fromJSON(inputs.config).test-src != 'pypi') || (fromJSON(inputs.config).pkg-src != 'pypi')
2731
uses: actions/checkout@v4 # https://github.com/actions/checkout
2832
with:
2933
repository: ${{ fromJSON(inputs.config).repository }}
3034
ref: ${{ fromJSON(inputs.config).ref }}
3135
fetch-tags: true
32-
path: repo
33-
- uses: RepoDynamics/PyTester@v1
36+
path: repo/
37+
- name: Binary Distribution Download
38+
uses: actions/download-artifact@v4
3439
with:
35-
python-version: ${{ matrix.task.python }}
36-
test-src: ${{ fromJSON(inputs.config).test-src }}
37-
test-path: ${{ fromJSON(inputs.config).test-path }}
38-
test-name: ${{ fromJSON(inputs.config).test-name }}
39-
test-version: ${{ fromJSON(inputs.config).test-version }}
40-
test-req-path: ${{ fromJSON(inputs.config).test-req-path }}
41-
pkg-src: ${{ fromJSON(inputs.config).pkg-src }}
42-
pkg-path: ${{ fromJSON(inputs.config).pkg-path }}
43-
pkg-name: ${{ fromJSON(inputs.config).pkg-name }}
44-
pkg-version: ${{ fromJSON(inputs.config).pkg-version }}
45-
pkg-req-path: ${{ fromJSON(inputs.config).pkg-req-path }}
46-
retries: ${{ fromJSON(inputs.config).retries }}
47-
retry-sleep-seconds: ${{ fromJSON(inputs.config).retry-sleep-seconds }}
48-
pyargs: ${{ fromJSON(inputs.config).pyargs }}
49-
args: ${{ fromJSON(inputs.config).args }}
50-
overrides: ${{ fromJSON(inputs.config).overrides }}
51-
- name: uname
52-
run: uname -a
40+
name: ${{ matrix.config.artifact.wheel.merge.name }}
41+
pattern: ${{ matrix.config.artifact.wheel.merge.pattern }}
42+
path: dist/
43+
merge-multiple: 'true'
44+
- name: Miniconda Setup
45+
uses: conda-incubator/setup-miniconda@v3
46+
with:
47+
miniforge-version: latest
48+
auto-update-conda: true
49+
environment-file: ${{ matrix.task.conda-env-file }}
50+
- name: Environment Installation
51+
run: |
52+
cd repo
53+
${{ matrix.task.install-env-script }}
54+
- name: Package Installation
55+
run: |
56+
cd dist
57+
${{ matrix.task.install-pkg-script }}
58+
- name: Test
59+
run: ${{ matrix.task.test-script }}
5360
- name: Report Upload
5461
if: ${{ !cancelled() }}
5562
uses: actions/upload-artifact@v4

.github/workflows/ci-test_old.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Install package from a given source and run unit-tests.
2+
# Install the package and run tests on a matrix of supported Python versions and operating systems.
3+
4+
name: '[Reusable]: Package - Test'
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
config:
10+
type: string
11+
required: true
12+
description: Configuration as a JSON string.
13+
14+
jobs:
15+
test:
16+
name: ${{ matrix.task.name }}
17+
permissions:
18+
id-token: write # For token-less upload of coverage reports to Codecov.
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
task: ${{ fromJSON(inputs.config).tasks }}
23+
runs-on: ${{ matrix.task.runner }}
24+
steps:
25+
- name: Repository Checkout
26+
if: (fromJSON(inputs.config).test-src != 'pypi') || (fromJSON(inputs.config).pkg-src != 'pypi')
27+
uses: actions/checkout@v4 # https://github.com/actions/checkout
28+
with:
29+
repository: ${{ fromJSON(inputs.config).repository }}
30+
ref: ${{ fromJSON(inputs.config).ref }}
31+
fetch-tags: true
32+
path: repo
33+
- uses: RepoDynamics/PyTester@v1
34+
with:
35+
python-version: ${{ matrix.task.python }}
36+
test-src: ${{ fromJSON(inputs.config).test-src }}
37+
test-path: ${{ fromJSON(inputs.config).test-path }}
38+
test-name: ${{ fromJSON(inputs.config).test-name }}
39+
test-version: ${{ fromJSON(inputs.config).test-version }}
40+
test-req-path: ${{ fromJSON(inputs.config).test-req-path }}
41+
pkg-src: ${{ fromJSON(inputs.config).pkg-src }}
42+
pkg-path: ${{ fromJSON(inputs.config).pkg-path }}
43+
pkg-name: ${{ fromJSON(inputs.config).pkg-name }}
44+
pkg-version: ${{ fromJSON(inputs.config).pkg-version }}
45+
pkg-req-path: ${{ fromJSON(inputs.config).pkg-req-path }}
46+
retries: ${{ fromJSON(inputs.config).retries }}
47+
retry-sleep-seconds: ${{ fromJSON(inputs.config).retry-sleep-seconds }}
48+
pyargs: ${{ fromJSON(inputs.config).pyargs }}
49+
args: ${{ fromJSON(inputs.config).args }}
50+
overrides: ${{ fromJSON(inputs.config).overrides }}
51+
- name: uname
52+
run: uname -a
53+
- name: Report Upload
54+
if: ${{ !cancelled() }}
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: ${{ matrix.task.artifact.report.name }}
58+
path: report
59+
- name: CodeCov Upload
60+
if: ${{ !cancelled() && fromJSON(inputs.config).upload-codecov }}
61+
# https://github.com/marketplace/actions/codecov
62+
# https://github.com/codecov/codecov-action
63+
env:
64+
OS: ${{ runner.os }}
65+
PYTHON: ${{ matrix.task.python }}
66+
uses: codecov/codecov-action@v4
67+
with:
68+
# TODO: Check that env_vars are correctly set. (https://github.com/codecov/codecov-action/pull/64)
69+
codecov_yml_path: repo/${{ fromJSON(inputs.config).codecov-yml-path }}
70+
directory: report
71+
env_vars: OS,PYTHON
72+
fail_ci_if_error: false
73+
root_dir: repo
74+
use_oidc: true # https://github.com/codecov/codecov-action/issues/1489#issuecomment-2197308411
75+
verbose: true
76+
report:
77+
name: Report
78+
if: ${{ !cancelled() && fromJSON(inputs.config).artifact.report.merge }}
79+
needs: test
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Artifact Merge
83+
uses: actions/upload-artifact/merge@v4
84+
with:
85+
name: ${{ fromJSON(inputs.config).artifact.report.merge.name }}
86+
pattern: ${{ fromJSON(inputs.config).artifact.report.merge.pattern }}
87+
include-hidden-files: ${{ fromJSON(inputs.config).artifact.report.include-hidden }}
88+
retention-days: ${{ fromJSON(inputs.config).artifact.report.retention-days }}
89+
separate-directories: 'true'
90+
delete-merged: 'true'

0 commit comments

Comments
 (0)