1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
name: CI
on:
push:
tags:
- v*
branches:
- main
pull_request:
permissions:
# none-all, which doesn't exist, but
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow
# implies that the token still gets created. Elsewhere we learn that any
# permission not mentioned here gets turned to `none`.
actions: none
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.6.1
with:
cache: 'pip'
- name: install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libnss-db libdb-dev libcurl4-gnutls-dev libgnutls28-dev libldap2-dev libsasl2-dev
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest-github-actions-annotate-failures
- name: Test
run: |
mkdir -p test-results
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo ${{ github.event.pull_request.head.sha }} > test-results/sha-number
else
echo ${{ github.sha }} > test-results/sha-number
fi
python setup.py test --addopts "-v --durations=0 --junitxml=test-results/junit.xml --cov=nss_cache"
- uses: codecov/codecov-action@v3
if: always()
- name: Install
run: pip install --user .
- name: slapd Regression Test
run: |
sudo apt-get install -y slapd ldap-utils libnss-db db-util
tests/slapd-regtest
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: test-results/
- name: pylint
run: |
pip install pylint
pylint nsscache nss_cache
# TODO(jaq): eventually make this lint clean and remove this line
continue-on-error: true
|