Skip to content

Add analyze test case #3813

Add analyze test case

Add analyze test case #3813

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-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
pip install $(grep -iE "pylint|pycodestyle" analyzer/requirements_py/dev/requirements.txt)
- name: Run tests
run: make pylint pycodestyle
tools:
name: Tools (report-converter, etc.)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Setup Bazel
uses: abhinavsingh/setup-bazel@v3
with:
version: 4.0.0
- name: Install common dependencies
run: |
sudo apt-get update -q
sudo apt-get install gcc-multilib
- name: Run build-logger tests
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
working-directory: tools/bazel
run: |
pip install -r requirements_py/dev/requirements.txt
make test
analyzer:
name: Analyzer
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: sh .github/workflows/install-deps.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
common:
name: Common libraries
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install requirements
working-directory: codechecker_common
run: |
pip install -r requirements_py/dev/requirements.txt
- name: Run mypy tests
working-directory: codechecker_common/tests
run: make mypy
web:
name: Web
runs-on: ubuntu-20.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.8'
- 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
gui:
name: GUI
runs-on: ubuntu-20.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.8'
- uses: actions/setup-node@v1
with:
node-version: '16.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
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 }}