Skip to content

Commit

Permalink
cleanup: Use github actions matrix to simplify CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Dec 27, 2023
1 parent 82d8265 commit 132f165
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 112 deletions.
20 changes: 10 additions & 10 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ branches:
protection:
required_status_checks:
contexts:
- "analysis (autotools)"
- "analysis (clang-tidy)"
- "analysis (compcert)"
- "analysis (cppcheck)"
- "analysis (doxygen)"
- "analysis (misra)"
- "analysis (tcc)"
- "analysis (tokstyle)"
- "bazel-dbg"
- "bazel-opt"
- "build-android"
- "build-autotools"
- "build-compcert"
- "build-macos"
- "build-tcc"
- "build-win32"
- "build-win64"
- "build-windows (32)"
- "build-windows (64)"
- "ci/circleci: asan"
- "ci/circleci: bazel-asan"
- "ci/circleci: bazel-msan"
Expand All @@ -33,8 +38,6 @@ branches:
- "ci/circleci: ubsan"
- "cimple"
- "cimplefmt"
- "clang-tidy"
- "cppcheck"
- "CodeFactor"
- "code-review/reviewable"
- "common / buildifier"
Expand All @@ -47,14 +50,11 @@ branches:
- "docker-toxcore-js"
- "docker-win32"
- "docker-win64"
- "doxygen"
- "freebsd"
- "Hound"
- "misra"
- "mypy"
- "program-analysis"
- "sonar-scan"
- "tokstyle"
- "TokTok.c-toxcore"
- "TokTok.c-toxcore (windows_msvc_conan shared)"
- "TokTok.c-toxcore (windows_msvc_conan static)"
Expand Down
131 changes: 29 additions & 102 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,102 +13,27 @@ jobs:
common:
uses: TokTok/ci-tools/.github/workflows/common-ci.yml@master

cppcheck:
analysis:
strategy:
matrix:
tool: [autotools, clang-tidy, compcert, cppcheck, doxygen, misra, tcc, tokstyle]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v4
with:
file: other/docker/cppcheck/Dockerfile
file: other/docker/${{ matrix.tool }}/Dockerfile

mypy:
coverage-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install mypy
run: pip install mypy
- name: Run mypy
run: |
(find . -name "*.py" -and -not -name "conanfile.py"; grep -lR '^#!.*python') \
| xargs -n1 -P8 mypy --strict
clang-tidy:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v4
with:
file: other/docker/clang-tidy/Dockerfile

doxygen:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v4
with:
file: other/docker/doxygen/Dockerfile

tokstyle:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v4
with:
file: other/docker/tokstyle/Dockerfile

misra:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v4
with:
file: other/docker/misra/Dockerfile

build-autotools:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v4
with:
file: other/docker/autotools/Dockerfile

build-tcc:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v4
with:
file: other/docker/tcc/Dockerfile

build-compcert:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v4
with:
file: other/docker/compcert/Dockerfile
- name: Build, test, and upload coverage
run: other/docker/coverage/run

cimplefmt:
runs-on: ubuntu-latest
Expand All @@ -119,23 +44,17 @@ jobs:
- name: Run cimplefmt
run: other/docker/cimplefmt/run -u $(find tox* -name "*.[ch]")

build-win32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cross compilation
run: .github/scripts/cmake-win32 script

build-win64:
build-windows:
strategy:
matrix:
bits: [32, 64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cross compilation
run: .github/scripts/cmake-win64 script
run: .github/scripts/cmake-win${{ matrix.bits }} script

build-macos:
runs-on: macos-latest
Expand All @@ -146,22 +65,30 @@ jobs:
- name: Build and test
run: .github/scripts/cmake-osx

coverage-linux:
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build, test, and upload coverage
run: other/docker/coverage/run
- run: .github/scripts/cmake-android armeabi-v7a
- run: .github/scripts/cmake-android arm64-v8a
- run: .github/scripts/cmake-android x86
- run: .github/scripts/cmake-android x86_64

build-android:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- run: .github/scripts/cmake-android armeabi-v7a
- run: .github/scripts/cmake-android arm64-v8a
- run: .github/scripts/cmake-android x86
- run: .github/scripts/cmake-android x86_64
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install mypy
run: pip install mypy
- name: Run mypy
run: |
(find . -name "*.py" -and -not -name "conanfile.py"; grep -lR '^#!.*python') \
| xargs -n1 -P8 mypy --strict

0 comments on commit 132f165

Please sign in to comment.