summaryrefslogtreecommitdiff
path: root/.github/workflows/test.yml
blob: 88781025435893911a0f3207603c8b9c554fa7d8 (plain)
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
name: Run tests
on:
  push:
    branches: [main]
  pull_request:
  create:

jobs:
  test:
    strategy:
      matrix:
        os: ["ubuntu-latest", "windows-latest", "macos-latest"]
        py: ["3.11", "3.10", "3.9", "3.8", "3.7"]

    runs-on: ${{ matrix.os }}
    name: Run test with Python ${{ matrix.py }} on ${{ matrix.os }}

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.py }}
          cache: "pip"

      - name: Build
        shell: bash
        run: |
          pip install -r requirements.txt pytest
          make cython
          pip install .

      - name: Test (C extension)
        shell: bash
        run: |
          pytest -v test

      - name: Test (pure Python fallback)
        shell: bash
        run: |
          MSGPACK_PUREPYTHON=1 pytest -v test