File: tests.yaml

package info (click to toggle)
pdudaemon 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 460 kB
  • sloc: python: 3,318; sh: 50; makefile: 12
file content (86 lines) | stat: -rw-r--r-- 2,651 bytes parent folder | download
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
name: Run tests
on:
  push:
    branches-ignore:
      - "gh-readonly-queue/**"
    tags:
      - "*"
  workflow_dispatch:
  pull_request:
  merge_group:
jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v6
      - name: Build container
        run: docker build -t pdudaemon-ci -f Dockerfile.dockerhub .
      - name: Run pytest
        run: docker run -v $(pwd):/p -w /p pdudaemon-ci /root/.local/pipx/venvs/pdudaemon/bin/pytest
      - name: Run functional tests
        run: docker run -v $(pwd):/p -w /p pdudaemon-ci sh -c "./share/pdudaemon-test.sh"
  tests-trixie:
    runs-on: ubuntu-latest
    steps:
      - name: check out repository code
        uses: actions/checkout@v6
      - name: Build container
        run: docker build --build-arg DEBIAN_VERSION=trixie -t pdudaemon-ci -f Dockerfile.dockerhub .
      - name: Run pytest
        run: docker run -v $(pwd):/p -w /p pdudaemon-ci /root/.local/share/pipx/venvs/pdudaemon/bin/pytest
      - name: Run functional tests
        run: docker run -v $(pwd):/p -w /p pdudaemon-ci sh -c "./share/pdudaemon-test.sh"

  build:
    needs:
      - tests
      - tests-trixie
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v6
        with:
          # include tags and full history for setuptools_scm
          fetch-depth: 0
      - name: Install build deps
        run: python -m pip install -U build
      - name: Build package
        run: python -m build
      - name: Upload dist
        uses: actions/upload-artifact@v6
        with:
          name: dist
          path: dist/

  pypi-publish-test:
    if: ${{ github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/main') }}
    needs: build
    runs-on: ubuntu-latest
    permissions:
      id-token: write
    steps:
      - name: Download dist
        uses: actions/download-artifact@v7
        with:
          name: dist
          path: dist/
      - name: Publish distribution package to TestPyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          repository-url: https://test.pypi.org/legacy/

  pypi-publish:
    if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
    needs: pypi-publish-test
    runs-on: ubuntu-latest
    permissions:
      id-token: write
    steps:
      - name: Download dist
        uses: actions/download-artifact@v7
        with:
          name: dist
          path: dist/
      - name: Publish distribution package to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1