aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorJ08nY2021-01-22 17:02:25 +0100
committerJ08nY2021-01-23 01:15:27 +0100
commit28546dad01a25ce101d6b49924f521c2ef5ffa98 (patch)
treef8eea4a4cc079ba830a27a2ce239aef451ed6597 /.github/workflows
parent31d72722ad94d4fbcf7c484137730f54bd6a4138 (diff)
downloadpyecsca-28546dad01a25ce101d6b49924f521c2ef5ffa98.tar.gz
pyecsca-28546dad01a25ce101d6b49924f521c2ef5ffa98.tar.zst
pyecsca-28546dad01a25ce101d6b49924f521c2ef5ffa98.zip
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/lint.yml52
-rw-r--r--.github/workflows/test.yml63
2 files changed, 115 insertions, 0 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 0000000..ae3693e
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,52 @@
+name: Lint
+
+on: [push, pull_request]
+
+env:
+ LLVM_CONFIG: /usr/bin/llvm-config-10
+ PS_PACKAGES: libps4000 libps5000 libps6000
+ GMP_PACKAGES: libgmp-dev libmpfr-dev libmpc-dev
+ OTHER_PACKAGES: swig gcc libpcsclite-dev llvm-10 libllvm10 llvm-10-dev
+
+jobs:
+ lint:
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ - uses: actions/cache@v2
+ with:
+ path: ~/.cache/pip
+ key: pip-${{ runner.os }}-${{ hashFiles('setup.py') }}
+ restore-keys: |
+ pip-${{ runner.os }}-
+ - name: Setup Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.9
+ - 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
+ - name: Install picoscope bindings
+ run: |
+ git clone https://github.com/colinoflynn/pico-python && cd pico-python && python setup.py install && cd ..
+ git clone https://github.com/picotech/picosdk-python-wrappers && cd picosdk-python-wrappers && python setup.py install && cd ..
+ - name: Install dependencies
+ run: |
+ python -m pip install -U pip setuptools wheel
+ pip install -e ".[picoscope_sdk, picoscope_alt, chipwhisperer, smartcard, gmp, test, dev]"
+ - name: Typecheck
+ run: |
+ make typecheck-all
+ - name: Codestyle
+ run: |
+ make codestyle-all
+ - name: Documentation coverage
+ run: |
+ make doc-coverage \ No newline at end of file
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..5a799d0
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,63 @@
+name: Test
+
+on: [push, pull_request]
+
+env:
+ LLVM_CONFIG: /usr/bin/llvm-config-10
+ PS_PACKAGES: libps4000 libps5000 libps6000
+ GMP_PACKAGES: libgmp-dev libmpfr-dev libmpc-dev
+ OTHER_PACKAGES: swig gcc libpcsclite-dev llvm-10 libllvm10 llvm-10-dev
+
+jobs:
+ test:
+ runs-on: ubuntu-20.04
+ strategy:
+ matrix:
+ python-version: [3.8, 3.9]
+ gmp: [0, 1]
+ env:
+ PYTHON: ${{ matrix.python-version }}
+ USE_GMP: ${{ matrix.gmp }}
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+ - uses: actions/cache@v2
+ with:
+ path: ~/.cache/pip
+ key: pip-${{ runner.os }}-${{ matrix.gmp }}-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
+ restore-keys: |
+ pip-${{ runner.os }}-${{ matrix.gmp }}-${{ matrix.python-version }}-
+ pip-${{ runner.os }}-${{ matrix.gmp }}-
+ pip-${{ runner.os }}-
+ - name: Setup Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - 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
+ if [ $USE_GMP == 1 ]; then sudo apt-get install -y $GMP_PACKAGES; fi
+ - name: Install picoscope bindings
+ run: |
+ git clone https://github.com/colinoflynn/pico-python && cd pico-python && python setup.py install && cd ..
+ git clone https://github.com/picotech/picosdk-python-wrappers && cd picosdk-python-wrappers && python setup.py install && cd ..
+ - name: Install dependencies
+ run: |
+ python -m pip install -U pip setuptools wheel
+ if [ $USE_GMP == 1 ]; then pip install -e ".[picoscope_sdk, picoscope_alt, chipwhisperer, smartcard, gmp, test, dev]"; fi
+ if [ $USE_GMP == 0 ]; then pip install -e ".[picoscope_sdk, picoscope_alt, chipwhisperer, smartcard, test, dev]"; fi
+ - name: Test
+ run: |
+ make test
+ - name: Code coverage
+ uses: codecov/codecov-action@v1
+ if: ${{ matrix.python-version == 3.9 }}
+ with:
+ env_vars: PYTHON,USE_GMP
+ functionalities: gcov \ No newline at end of file