aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/docs.yml
blob: f89cb3a854a5158be23da90e0ef4b2625eff2d7f (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
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
name: Docs

on:
  push:
    branches:
      - master

env:
  LLVM_CONFIG: /usr/bin/llvm-config-10
  PS_PACKAGES: libps4000 libps5000 libps6000
  GMP_PACKAGES: libgmp-dev libmpfr-dev libmpc-dev
  FLINT_PACKAGES: libflint-dev
  OTHER_PACKAGES: pandoc swig gcc libpcsclite-dev llvm-14 libllvm14 llvm-14-dev libpari-dev pari-gp pari-seadata gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi

jobs:
  docs:
    runs-on: ubuntu-latest
    # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
    permissions:
      pages: write      # to deploy to Pages
      id-token: write   # to verify the deployment originates from an appropriate source
    # Deploy to the github-pages environment
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    # Do the build and deploy
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: true
          path: pyecsca
      - uses: actions/checkout@v4
        with:
          repository: J08nY/pyecsca-codegen
          submodules: true
          path: pyecsca-codegen
      - uses: actions/cache@v4
        with:
          path: ~/.cache/pip
          key: pip-${{ runner.os }}-3.11-${{ hashFiles('pyproject.toml') }}
          restore-keys: |
            pip-${{ runner.os }}-
      - name: Setup Python 3.11
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Add picoscope repository
        run: |
          curl "https://labs.picotech.com/debian/dists/picoscope/Release.gpg.key" | sudo apt-key add
          sudo echo "deb https://labs.picotech.com/debian/ picoscope main" | sudo tee /etc/apt/sources.list.d/picoscope.list
          sudo apt-get update
      - name: Install system dependencies
        run: |
          sudo apt-get install -y $PS_PACKAGES $OTHER_PACKAGES $GMP_PACKAGES $FLINT_PACKAGES
      - name: Install picoscope bindings
        run: |
          python -m pip install -U pip setuptools wheel
          git clone https://github.com/colinoflynn/pico-python && cd pico-python && pip install . && cd ..
          git clone https://github.com/picotech/picosdk-python-wrappers && cd picosdk-python-wrappers && pip install . && cd ..
      - name: Install pyecsca
        working-directory: pyecsca
        run: |
          pip install -e ".[picoscope_sdk, picoscope_alt, chipwhisperer, smartcard, gmp, flint, leia, test, dev, doc]"
      - name: Install pyecsca-codegen
        working-directory: pyecsca-codegen
        run: |
          pip install -e "."
      - name: Build docs
        working-directory: pyecsca/docs
        run: |
          make apidoc
          make html
      - uses: actions/upload-pages-artifact@v3.0.1
        with:
          path: pyecsca/docs/_build/html/
      - id: deployment
        uses: actions/deploy-pages@v4