aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/test.yml
blob: ac9beeee15ab96a9bf85ce3108be31978eb117d3 (plain) (blame)
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
name: Test

on:
  schedule: # Run every Monday at noon
    - cron: '0 12 * * 1'
  push:
  pull_request:

env:
  LLVM_CONFIG: /usr/bin/llvm-config-14
  OTHER_PACKAGES: swig libpcsclite-dev llvm-14 libllvm14 llvm-14-dev valgrind gdb gcc gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [ "3.9", "3.10", "3.11", "3.12" ]
    env:
      PYTHON: ${{ matrix.python-version }}
    steps:
      - uses: actions/checkout@v5
        with:
          submodules: true
      - uses: actions/cache@v4
        with:
          path: ~/.cache/pip
          key: pip-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
          restore-keys: |
            pip-${{ runner.os }}-${{ matrix.python-version }}-
            pip-${{ runner.os }}-
      - name: Setup Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y $OTHER_PACKAGES
      - name: Build libtommath
        run: |
          cd ext && make host stm32f3 && cd ..
      - name: Install dependencies
        run: |
          pip install -U pip setuptools wheel
      - name: Install pyecsca
        run: |
          git clone https://github.com/J08nY/pyecsca pyecsca-upstream && cd pyecsca-upstream && git submodule update --init && pip install -e ".[chipwhisperer, test, dev]" && cd ..
      - name: Install pyecsca-codegen
        run: |
          pip install -e ".[test, dev]"
      - name: Test
        run: |
          make test
      - name: Test (C)
        run: |
          cd test && make test && cd ..
      - name: Code coverage
        uses: codecov/codecov-action@v5
        if: ${{ matrix.python-version == 3.9 }}
        with:
          token: ${{ secrets.CODECOV_TOKEN }}