Skip to content

[ci] Windows test support #6150

[ci] Windows test support

[ci] Windows test support #6150

Workflow file for this run

name: codechecker-tests
# Triggers the workflow on push or pull request events.
on: [push, pull_request]
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Note: UI related linter tests will run in the gui job.
lint:
name: Linters (pylint, pycodestyle)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install $(grep -iE "pylint|pycodestyle" analyzer/requirements_py/dev/requirements.txt)
- name: Run pycodestyle & pylint
run: make -k pycodestyle pylint
type-checker:
name: Type checker (mypy)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Create venv-dev
run: |
make venv_dev
- name: Run mypy
run: |
make mypy
tools:
name: Tools (report-converter, etc.)
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.os == 'macos-latest' }}
strategy:
matrix:
os: [ubuntu-24.04, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Bazel
if: runner.os == 'Linux'
uses: abhinavsingh/setup-bazel@v3
with:
version: 4.0.0
- name: Install common dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -q
sudo apt-get install gcc-multilib
- name: Run build-logger tests
if: runner.os == 'Linux'
working-directory: analyzer/tools/build-logger
run: |
pip install -r requirements_py/dev/requirements.txt
make all
make test
- name: Run merge-clang-extdef-mappings tests
working-directory: analyzer/tools/merge_clang_extdef_mappings
run: |
pip install -r requirements_py/dev/requirements.txt
make test
- name: Run statistics-collector tests
working-directory: analyzer/tools/statistics_collector
run: |
pip install -r requirements_py/dev/requirements.txt
make test
- name: Run report-converter tests
working-directory: tools/report-converter
run: |
pip install -r requirements_py/dev/requirements.txt
make package
make test
- name: Run tu-collector tests
working-directory: tools/tu_collector
run: |
pip install -r requirements_py/dev/requirements.txt
make test
- name: Run bazel-compile-commands tests
if: runner.os == 'Linux'
working-directory: tools/bazel
run: |
pip install -r requirements_py/dev/requirements.txt
make test
analyzer:
name: Analyzer
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.os == 'macos-latest' }}
strategy:
matrix:
os: [ubuntu-24.04, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sh .github/workflows/install-deps.sh
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: sh .github/workflows/install-deps-macos.sh
- name: Build the package
run: |
make pip_dev_deps
BUILD_UI_DIST=NO make package
- name: Run analyzer tests
working-directory: analyzer
run: make test_unit test_functional
- name: Analyzer unit tests coverage
working-directory: analyzer
run: make test_unit_cov
web:
name: Web
runs-on: ubuntu-24.04
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
database: [sqlite, psql_pg8000, psql_psycopg2]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: sh .github/workflows/install-deps.sh
- name: Init .pgpass
if: matrix.database != 'sqlite'
run: |
echo '*:*:*:*:postgres' > $HOME/.pgpass
chmod 0600 $HOME/.pgpass
- name: Run tests
env:
PGPASSWORD: postgres
run: |
if [[ "${{ matrix.database != 'sqlite' }}" == "true" ]]
then
export PGPASSFILE=$HOME/.pgpass
fi
make pip_dev_deps
pip3 install -r web/requirements_py/auth/requirements.txt
BUILD_UI_DIST=NO make package
make -C web test_matrix_${{ matrix.database }}
- name: Run unit tests coverage
working-directory: web
run: make test_unit_cov
web-macos:
name: Web (macOS)
runs-on: macos-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: sh .github/workflows/install-deps-macos.sh
- name: Run tests
run: |
make pip_dev_deps
pip3 install -r web/requirements_py/auth/requirements.txt
BUILD_UI_DIST=NO make package
# Run full functional test suite.
cd web
make test_matrix_sqlite
env:
CC_TEST_API_WORKERS: "1"
CC_TEST_TASK_WORKERS: "1"
- name: Run unit tests coverage
working-directory: web
run: make test_unit_cov
# NOTE: The Windows jobs live in the dedicated `windows-iter.yml` workflow
# while the Windows suite is being stabilized (faster feedback, pytest
# timeouts). They should be folded back into this matrix once green.
gui:
name: GUI
runs-on: ubuntu-24.04
strategy:
matrix:
# FIXME: in Chrome the UI test cases run non-deterministically and
# sometimes fail. For this reason we will not run GUI test cases
# in Chrome.
browser: [firefox]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/setup-node@v1
with:
node-version: '20.x'
# - name: Update chrome
# run: |
# sudo apt-get update -q
# sudo apt-get install google-chrome-stable
- name: Install dependencies
run: sh .github/workflows/install-deps.sh
- name: Build the package
run: |
make pip_dev_deps
pip3 install -r web/requirements_py/auth/requirements.txt
make package
- name: Run tests
working-directory: web/server/vue-cli
env:
# CHROME_HEADLESS: 1
MOZ_HEADLESS: 1
DISPLAY: ":99.0"
run: |
export PATH="${{ github.workspace }}/build/CodeChecker/bin:$PATH"
npm run test:lint
npm run test:unit
# npm run test:e2e.${{ matrix.browser }}