|
| 1 | +name: Tests |
| 2 | +on: |
| 3 | + push: |
| 4 | + pull_request: |
| 5 | + workflow_dispatch: |
| 6 | + workflow_call: |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | +concurrency: |
| 10 | + group: tests-${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | +jobs: |
| 13 | + unit: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + python: ['3.10', '3.11', '3.12'] |
| 19 | + timeout-minutes: 20 |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + - uses: actions/setup-python@v5 |
| 23 | + with: |
| 24 | + python-version: ${{ matrix.python }} |
| 25 | + cache: pip |
| 26 | + - uses: actions/setup-node@v4 |
| 27 | + with: |
| 28 | + node-version: '22' |
| 29 | + - run: python -m pip install '.[test]' -r tests/requirements.txt |
| 30 | + - run: ruff check . && ruff format --check . |
| 31 | + - run: python -m pytest -m 'not docker' -q |
| 32 | + - run: python -m build |
| 33 | + - name: Verify installed wheel and packaged resources |
| 34 | + run: | |
| 35 | + python -m venv /tmp/abench-wheel |
| 36 | + /tmp/abench-wheel/bin/pip install dist/*.whl |
| 37 | + cd /tmp |
| 38 | + /tmp/abench-wheel/bin/abench --help |
| 39 | + /tmp/abench-wheel/bin/python -c "from pathlib import Path; import abench; p=Path(abench.__file__).parent; assert (p/'Dockerfile').is_file(); assert (p/'profiles/mtc.yaml').is_file(); assert (p/'runtime/build_sources.py').is_file()" |
| 40 | + docker: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + timeout-minutes: 30 |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + - uses: actions/setup-python@v5 |
| 46 | + with: |
| 47 | + python-version: '3.11' |
| 48 | + cache: pip |
| 49 | + - run: python -m pip install . pytest |
| 50 | + - name: Build exact sources and exercise serial and multiprocess runs |
| 51 | + env: |
| 52 | + ABENCH_DOCKER_TESTS: '1' |
| 53 | + run: | |
| 54 | + mkdir -p experiments |
| 55 | + python -m pytest tests/test_docker.py -v --basetemp=experiments/ci |
| 56 | + - name: Retain reports and diagnostics |
| 57 | + if: always() |
| 58 | + uses: actions/upload-artifact@v4 |
| 59 | + with: |
| 60 | + name: docker-experiments |
| 61 | + path: | |
| 62 | + experiments/ci/**/*.html |
| 63 | + experiments/ci/**/*.json |
| 64 | + experiments/ci/**/*.jsonl |
| 65 | + experiments/ci/**/*.txt |
| 66 | + experiments/ci/**/*.log |
| 67 | + experiments/ci/**/*.csv |
| 68 | + experiments/ci/**/*.yaml |
| 69 | + if-no-files-found: ignore |
0 commit comments