Presubmit Checks #658
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
name: Presubmit Checks | |
on: | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 2 * * 0' # Weekly | |
workflow_dispatch: | |
permissions: | |
packages: read | |
jobs: | |
pylint: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/charlesnicholson/docker-image:latest | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pylint build.py | |
run: . /work/venv/bin/activate && python -m pylint build.py tests/size_report.py | |
download: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/charlesnicholson/docker-image:latest | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build | |
run: ./b --download --paland -v | |
sanitizers: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/charlesnicholson/docker-image:latest | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
strategy: | |
matrix: | |
sanitizer: [ubsan, asan] | |
architecture: [32, 64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build | |
env: | |
CC: /usr/bin/clang | |
CXX: /usr/bin/clang++ | |
run: ./b --arch ${{ matrix.architecture }} --${{ matrix.sanitizer }} --paland -v | |
linux-gcc: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/charlesnicholson/docker-image:latest | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
strategy: | |
matrix: | |
configuration: [Debug, Release] | |
architecture: [32, 64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build | |
env: | |
CC: /usr/bin/gcc | |
CXX: /usr/bin/g++ | |
run: ./b --cfg ${{ matrix.configuration }} --arch ${{ matrix.architecture }} --paland -v | |
linux-clang: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/charlesnicholson/docker-image:latest | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
strategy: | |
matrix: | |
configuration: [Debug, Release] | |
architecture: [32, 64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build | |
env: | |
CC: /usr/bin/clang | |
CXX: /usr/bin/clang++ | |
run: ./b --cfg ${{ matrix.configuration }} --arch ${{ matrix.architecture }} --paland -v | |
macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
configuration: [Debug, Release] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Build | |
run: ./b --cfg ${{ matrix.configuration }} --paland -v | |
win: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
configuration: [Debug, Release] | |
architecture: [32, 64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Build | |
shell: cmd | |
run: | | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars${{ matrix.architecture }}.bat" | |
python.exe build.py --cfg ${{ matrix.configuration }} --paland -v --arch ${{ matrix.architecture }} | |
size-reports: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/charlesnicholson/docker-image:latest | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cortex-M0 | |
shell: bash | |
run: | | |
. /work/venv/bin/activate | |
python3 tests/size_report.py -p cm0 | |
- name: Cortex-M4 | |
shell: bash | |
run: | | |
. /work/venv/bin/activate | |
python3 tests/size_report.py -p cm4 | |
- name: Linux x64 | |
shell: bash | |
run: | | |
. /work/venv/bin/activate | |
python3 tests/size_report.py -p host | |
all-checks-pass: | |
needs: [pylint, download, sanitizers, linux-gcc, linux-clang, macos, win, size-reports] | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo Done | |