Skip to content

test: Fix pylint issues for cache test #326

test: Fix pylint issues for cache test

test: Fix pylint issues for cache test #326

Workflow file for this run

# Copyright 2023 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: rules-codechecker-tests
# Triggers the workflow on push or pull request events.
on:
push:
paths-ignore:
- "**/*.md"
- "README*"
- "LICENSE"
pull_request:
paths-ignore:
- "**/*.md"
- "README*"
- "LICENSE"
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ubuntu_test:
name: "Tests: Bazel ${{ matrix.bazel_version }} (Ubuntu)"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
bazel_version:
- "7.7.1"
- "8.5.1"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set bazel version to ${{ matrix.bazel_version }}
run: echo "${{ matrix.bazel_version }}" > .bazelversion
shell: bash
# I did not use our setup script to leverage
# the power of caching provided by this action.
- name: Setup environment
uses: mamba-org/setup-micromamba@v3
with:
environment-name: ci
environment-file: .ci/micromamba/ci.yaml
create-args: >-
bazel=${{ matrix.bazel_version }}
cache-environment: true
init-shell: bash
condarc: |
channels:
- conda-forge
- name: Print versions
run: |
bazel version
CodeChecker version
echo "[NOTE]: CodeChecker may find different analyzer binaries" \
"when invoking directly, or in bazel's sandbox environment!" \
"Be sure to double check during debugging."
CodeChecker analyzers
shell: bash -el {0}
- name: Run lint tests
run: |
pylint .
bazel test //test/buildifier --test_output=all
shell: bash -el {0}
# Splitting test runs to: bazel unit tests, bazel foss tests, python unittests
# Therefore: less wasted CI runtime.
- name: Run unit tests
run: |
bazel test //... --test_tag_filters=-foss --test_output=errors
shell: bash -el {0}
- name: Run foss tests
run: |
bazel test //test/foss/... --test_output=errors
shell: bash -el {0}
- name: Run python unittests
run: |
pytest test ${{ runner.debug == '1' && '--log-cli-level=DEBUG' || '' }}
shell: bash -el {0}
rhel9_test:
name: "Tests: Bazel ${{ matrix.bazel_version }} (RHEL9)"
runs-on: ubuntu-24.04
container:
image: redhat/ubi9:latest
options: --init
strategy:
fail-fast: false
matrix:
bazel_version:
- "7.7.1"
- "8.5.1"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set bazel version to ${{ matrix.bazel_version }}
run: echo "${{ matrix.bazel_version }}" > .bazelversion
shell: bash
- name: Setup environment
uses: mamba-org/setup-micromamba@v3
with:
environment-name: ci
environment-file: .ci/micromamba/ci.yaml
create-args: >-
bazel=${{ matrix.bazel_version }}
cache-environment: true
init-shell: bash
condarc: |
channels:
- conda-forge
- name: Create a non-root user
run: |
useradd -m test
chown -R test:test $GITHUB_WORKSPACE
chown -R test:test $HOME
chown -R test:test $MAMBA_ROOT_PREFIX
shell: bash -el {0}
- name: Print versions
run: |
runuser -u test -- bazel version
CodeChecker version
echo "[NOTE]: CodeChecker may find different analyzer binaries" \
"when invoking directly, or in bazel's sandbox environment!" \
"Be sure to double check during debugging."
CodeChecker analyzers
shell: bash -el {0}
- name: Run lint tests
run: |
pylint .
runuser -u test -- bazel test //test/buildifier --test_output=all
shell: bash -el {0}
# Splitting test runs to: bazel unit tests, bazel foss tests, python unittests
# Therefore: less wasted CI runtime.
- name: Run unit tests
run: |
runuser -u test -- bazel test //... --test_tag_filters=-foss --test_output=errors
shell: bash -el {0}
- name: Run foss tests
run: |
runuser -u test -- bazel test //test/foss/... --test_output=errors
shell: bash -el {0}
- name: Run python unittests
run: |
runuser -u test -- pytest test ${{ runner.debug == '1' && '--log-cli-level=DEBUG' || '' }}
shell: bash -el {0}