File: test.yml

package info (click to toggle)
ujson 5.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,148 kB
  • sloc: ansic: 2,789; python: 1,510; cpp: 50; makefile: 43; sh: 12
file content (111 lines) | stat: -rw-r--r-- 3,006 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Test

on: [push, pull_request, workflow_dispatch]

permissions: {}

env:
  FORCE_COLOR: 1

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        python-version:
          - "pypy3.11"
          - "3.14t"
          - "3.14"
          - "3.13t"
          - "3.13"
          - "3.12"
          - "3.11"
          - "3.10"
          - "3.9"
        os: [ubuntu-latest]
        include:
          - { python-version: "pypy-3.11", os: windows-latest }
          - { python-version: "pypy-3.11", os: macos-latest }
          - { python-version: "3.13", os: windows-latest }
          - { python-version: "3.13", os: macos-latest }
          - { python-version: "3.14", os: windows-latest }
          - { python-version: "3.14", os: macos-latest }

    steps:
      - uses: actions/checkout@v5

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          allow-prereleases: true
          cache: pip
          cache-dependency-path: "setup.py"

      - name: Set PYTHON_GIL
        if: endsWith(matrix.python-version, 't')
        run: |
          echo "PYTHON_GIL=0" >> "$GITHUB_ENV"

      - name: Install dependencies
        run: |
          python -m pip install -U pip
          python -m pip install -U pytest
          python -m pip install .
        env:
          CFLAGS: '-DDEBUG'

      - name: Tests
        run: |
          python -m pytest --capture=no

      - name: Test without debug mode
        run: |
          git clean -Xfd
          python -m pip install --force-reinstall .
          python -m pytest

      - name: Test with coverage
        if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.python-version == '3.10' }}
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
        run: |
          pip install -e .
          pip install coverage
          CFLAGS="--coverage -O0" python setup.py -q build_ext --inplace -f
          coverage run -m pytest
          ./scripts/coverage.sh
          bash <(curl -s https://codecov.io/bash) -X gcov

  cross-arch:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        architecture: [ppc64le, s390x, aarch64, arm/v6, 386]
    steps:
      - uses: actions/checkout@v5
      - run: git fetch --prune --unshallow

      # https://github.com/docker/setup-qemu-action
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v3

      - name: Test
        run: |
          docker run -v "$PWD:/io" --platform=linux/${{ matrix.architecture }} python:alpine ash -e -c '
            apk add gcc g++ musl-dev git
            cd /io
            git config --global --add safe.directory /io
            pip install . pytest
            FORCE_COLOR=1 pytest
          '

  success:
    needs: [test, cross-arch]
    runs-on: ubuntu-latest
    name: test successful
    steps:
      - name: Success
        run: echo Test successful