Skip to content

.github/workflows/main.yml #2360

.github/workflows/main.yml

.github/workflows/main.yml #2360

Workflow file for this run

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
#
# Verify the build and installation of SDB.
#
install:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: python3 setup.py install
#
# The statement below is used for debugging the Github job.
#
- run: python3 --version
#
# Verify "pylint" runs successfully.
#
# Note, we need to have "drgn" installed in order to run "pylint".
# Thus, prior to running "pylint" we have to clone, build, and install
# the "drgn" from source (there's no package currently available).
#
pylint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.8'
- run: ./.github/scripts/install-drgn.sh
- run: python3 -m pip install pylint pytest
- run: pylint -d duplicate-code -d invalid-name sdb
- run: pylint -d duplicate-code -d invalid-name tests
#
# Verify "pytest" runs successfully.
#
# Note, we need to have "drgn" installed in order to "pytest". Thus,
# prior to running "pytest" we have to clone, build, and install the
# "drgn" from source (there's no package currently available). In
# addition, we install "libkdumpfile" in the same way beforehand
# (there's no package currently for libkdumpfile either) so "drgn"
# can open kdump-compressed crash dumps for the integration tests.
#
pytest:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9]
dump: [dump.201912060006.tar.lzma, dump.202303131823.tar.gz]
env:
AWS_DEFAULT_REGION: 'us-west-2'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: python3 -m pip install aws python-config pytest pytest-cov
- run: ./.github/scripts/install-libkdumpfile.sh
- run: ./.github/scripts/install-drgn.sh
- run: ./.github/scripts/download-dump-from-s3.sh ${{ matrix.dump }}
- run: pytest -v --cov sdb --cov-report xml tests
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
#
# Verify "yapf" runs successfully.
#
yapf:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.8'
- run: python3 -m pip install yapf
- run: yapf --diff --style google --recursive sdb
- run: yapf --diff --style google --recursive tests
#
# Verify "mypy" runs successfully.
#
# Note, we need to have "drgn" installed in order to run "mypy".
# Thus, prior to running "mypy" we have to clone, build, and install
# the "drgn" from source (there's no package currently available).
#
# Also note the following 2 things specific to mypy:
# [1] We expicitly install version 0.730 as the default version that
# comes with Ubuntu is 0.75 which has a couple of bugs triggered
# by our codebase (they've been resolved on trunk though so we
# may want to change this soon).
# [2] We supply --ignore-missing-imports to the tests package because
# pytest doesn't provide stubs on typeshed.
#
mypy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.8'
- run: ./.github/scripts/install-drgn.sh
- run: python3 -m pip install mypy==0.730
- run: python3 -m mypy --strict --show-error-codes -p sdb
- run: python3 -m mypy --strict --ignore-missing-imports --show-error-codes -p tests
#
# Verify that "shfmt" ran successfully against our shell scripts.
#
shfmt:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: delphix/actions/shfmt@master