Run github actions on macos-latest #2731
Workflow file for this run
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: codechecker-tests | ||
# Triggers the workflow on push or pull request events. | ||
on: [push, pull_request] | ||
permissions: read-all | ||
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 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
- name: Install dependencies | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
sh .github/workflows/install-deps.sh | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
sh .github/workflows/install-deps-osx.sh | ||
else | ||
echo "$RUNNER_OS not supported" | ||
exit 1 | ||
fi | ||
- 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 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
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: | ||
strategy: | ||
matrix: | ||
database: [sqlite, psql_pg8000, psql_psycopg2] | ||
os: [ubuntu-20.04, macos-latest] | ||
name: Web | ||
runs-on: ${{ matrix.os }} | ||
if: runner.os == 'Linux' | ||
Check failure on line 152 in .github/workflows/test.yml GitHub Actions / codechecker-testsInvalid workflow file
|
||
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 | ||
steps: | ||
# Service containers are not supported on macOS | ||
- name: Run postgres as a container | ||
if: runner.os == 'macOS' | ||
run: | | ||
docker run -d -p 5432:5432 postgres | ||
sleep 10 # Give the container some time to start, proper healthcheck woud be better | ||
- 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 | ||
run: | | ||
echo '*:*:*:*:postgres' > $HOME/.pgpass | ||
chmod 0600 $HOME/.pgpass | ||
- name: Run tests | ||
env: | ||
PGPASSWORD: postgres | ||
run: | | ||
export PGPASSFILE=$HOME/.pgpass | ||
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 }} |