Enforce cpplint #194
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: ["master"] | |
tags: ["*"] | |
pull_request: | |
branches: ["master"] | |
name: Continuous integration | |
jobs: | |
native: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install packages | |
run: export DEBIAN_FRONTEND=noninteractive && | |
sudo apt-get update && | |
sudo apt-get install -y | |
black | |
ccache | |
cmake | |
cpplint | |
g++ | |
gcc | |
git | |
libboost-dev | |
libboost-python-dev | |
libc6-dev-i386 | |
libcapstone-dev | |
libdw-dev | |
python3 | |
python3-flake8 | |
python3-pip | |
python3-skbuild | |
python3-venv | |
quilt | |
make | |
ninja-build | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "true" | |
- name: Generate a timestamp | |
run: echo "TIMESTAMP=$(date +%Y%m%d%H%M%S)" >>"$GITHUB_ENV" | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pip | |
~/.ccache | |
key: native-${{ env.TIMESTAMP }} | |
restore-keys: native- | |
- name: Configure ccache | |
run: echo "CCACHE_DIR=$HOME/.ccache" >>"$GITHUB_ENV" | |
- name: Show ccache stats | |
run: ccache --show-stats --verbose | |
- name: Check code style | |
run: ./fmt --check | |
- name: Build a source distribution | |
run: python3 setup.py sdist | |
- name: Build | |
run: PATH=/usr/lib/ccache:$PATH ./ci | |
--skip-repair | |
-DVALGRIND_CONFIGURE_FLAGS=--disable-dependency-tracking | |
--sanitize | |
- name: Smoke test | |
run: python3 -m pip install --user dist/wheelhouse/*.whl && | |
./python3-asan "$(command -v memtrace)" record true && | |
./python3-asan "$(command -v memtrace)" report | tail | |
- name: Show and reset ccache stats | |
run: ccache --show-stats --verbose --zero-stats | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: native | |
path: dist/ | |
cross: | |
strategy: | |
matrix: | |
arch: [aarch64,arm,i686,ppc64,ppc64le,s390x,x86_64] | |
python: [cp36-cp36m,cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311,cp312-cp312] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "true" | |
- name: Generate a timestamp | |
run: echo "TIMESTAMP=$(date +%Y%m%d%H%M%S)" >>"$GITHUB_ENV" | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pip | |
~/.ccache | |
key: cross-${{ matrix.arch }}-${{ matrix.python }}-${{ env.TIMESTAMP }} | |
restore-keys: cross-${{ matrix.arch }}-${{ matrix.python }}- | |
- name: Pull the Docker image | |
run: ./in-docker | |
--arch=${{ matrix.arch }} | |
--python=${{ matrix.python }} | |
true | |
- name: Show ccache stats | |
run: ./in-docker | |
--arch=${{ matrix.arch }} | |
--python=${{ matrix.python }} | |
ccache --show-stats --verbose | |
- name: Build | |
run: ./ci-docker | |
--arch=${{ matrix.arch }} | |
--python=${{ matrix.python }} | |
-DVALGRIND_CONFIGURE_FLAGS=--disable-dependency-tracking | |
- name: Show and reset ccache stats | |
run: ./in-docker | |
--arch=${{ matrix.arch }} | |
--python=${{ matrix.python }} | |
ccache --show-stats --verbose --zero-stats | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cross-${{ matrix.arch }}-${{ matrix.python }} | |
path: dist/ | |
PyPI: | |
runs-on: ubuntu-latest | |
needs: | |
- native | |
- cross | |
if: startsWith(github.ref, 'refs/tags/') | |
environment: PyPI | |
steps: | |
- name: Install packages | |
run: export DEBIAN_FRONTEND=noninteractive && | |
sudo apt-get update && | |
sudo apt-get install -y | |
tree | |
twine | |
unzip | |
- uses: actions/download-artifact@v4 | |
- name: Show artifacts | |
run: tree | |
- name: Upload artifacts | |
env: | |
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
run: twine upload --non-interactive --verbose | |
native/*.tar.gz | |
cross-*/wheelhouse/*.whl |