-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[test] Introduce Github action for CodeChecker tests #3066
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | ||
sudo add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main' -y | ||
|
||
sudo apt-get update -q | ||
|
||
sudo apt-get install \ | ||
g++-6 \ | ||
gcc-multilib \ | ||
libc6-dev-i386 \ | ||
libpq-dev \ | ||
libldap2-dev \ | ||
libsasl2-dev \ | ||
libssl-dev \ | ||
clang-11 \ | ||
clang-tidy-11 | ||
|
||
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-11 9999 | ||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 9999 | ||
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-11 9999 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
name: codechecker-tests | ||
|
||
# Triggers the workflow on push or pull request events. | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
# Note: UI related linter tests will run in the gui job. | ||
lint: | ||
name: Linters (pylint, pycodestyle) | ||
|
||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.6' | ||
- name: Install dependencies | ||
run: | | ||
pip install $(grep -iE "pylint|pycodestyle" analyzer/requirements_py/dev/requirements.txt) | ||
- name: Run tests | ||
run: make pylint pycodestyle | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are there any javascript linters? |
||
|
||
tools: | ||
name: Tools (plist-to-html, report-converter, etc.) | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.6' | ||
- 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: | | ||
make -f Makefile.manual | ||
make -f Makefile.manual 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 codechecker-report-hash tests | ||
working-directory: tools/codechecker_report_hash | ||
run: | | ||
pip install -r requirements_py/dev/requirements.txt | ||
make test | ||
|
||
- name: Run plist-to-html tests | ||
working-directory: tools/plist_to_html | ||
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: make test | ||
|
||
analyzer: | ||
name: Analyzer | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.6' | ||
|
||
- 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 | ||
|
||
web: | ||
name: Web | ||
runs-on: ubuntu-18.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@v2 | ||
with: | ||
python-version: '3.6' | ||
|
||
- name: Install dependencies | ||
run: sh .github/workflows/install-deps.sh | ||
|
||
- name: Init .pgpass | ||
run: | | ||
echo '*:*:*:*:postgres' > $HOME/.pgpass | ||
chmod 0600 $HOME/.pgpass | ||
|
||
- name: Run tests | ||
env: | ||
PGPASSWORD: postgres | ||
run: | | ||
export PGPASSFILE=$HOME/.pgpass | ||
|
||
make pip_dev_deps | ||
BUILD_UI_DIST=NO make package | ||
|
||
make -C web test_matrix_${{ matrix.database }} | ||
|
||
gui: | ||
name: GUI | ||
runs-on: ubuntu-18.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@v2 | ||
with: | ||
python-version: '3.6' | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.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 }} |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there triggers for merging to master master branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there is no such option. See: https://gh.neting.ccmunity/t/trigger-workflow-only-on-pull-request-merge/17359/3. It says that on merge event the push event also will be called.