• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Coverage
2
3on:
4  push:
5    branches:
6    - master
7    - 3.8
8    - 3.7
9    paths-ignore:
10    - 'Doc/**'
11    - 'Misc/**'
12  #pull_request:
13  #  branches:
14  #  - master
15  #  - 3.8
16  #  - 3.7
17  #  paths-ignore:
18  #  - 'Doc/**'
19  #  - 'Misc/**'
20
21jobs:
22  coverage_ubuntu:
23    name: 'Ubuntu (Coverage)'
24    runs-on: ubuntu-latest
25    env:
26      OPENSSL_VER: 1.1.1f
27    steps:
28    - uses: actions/checkout@v2
29    - name: Install Dependencies
30      run: sudo ./.github/workflows/posix-deps-apt.sh
31    - name: 'Restore OpenSSL build'
32      id: cache-openssl
33      uses: actions/cache@v1
34      with:
35        path: ./multissl/openssl/${{ env.OPENSSL_VER }}
36        key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
37    - name: Install OpenSSL
38      if: steps.cache-openssl.outputs.cache-hit != 'true'
39      run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
40    - name: Configure CPython
41      run: ./configure --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
42    - name: Build CPython
43      run: make -j4
44    - name: Display build info
45      run: make pythoninfo
46    - name: 'Coverage Preparation'
47      run: |
48        ./python -m venv .venv
49        source ./.venv/bin/activate
50        python -m pip install -U coverage
51        python -m test.pythoninfo
52    - name: 'Tests with coverage'
53      run: >
54        source ./.venv/bin/activate &&
55        xvfb-run python -m coverage
56        run --branch --pylib
57        -m test
58        --fail-env-changed
59        -uall,-cpu
60        -x test_multiprocessing_fork
61        -x test_multiprocessing_forkserver
62        -x test_multiprocessing_spawn
63        -x test_concurrent_futures
64        || true
65    - name: 'Publish code coverage results'
66      run: |
67        source ./.venv/bin/activate
68        bash <(curl -s https://codecov.io/bash)
69      env:
70        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
71
72  c_coverage_ubuntu:
73    name: 'Ubuntu (C Coverage)'
74    runs-on: ubuntu-latest
75    steps:
76    - uses: actions/checkout@v2
77    - name: Install Dependencies
78      run: sudo ./.github/workflows/posix-deps-apt.sh
79    - name: Configure CPython
80      run: ./configure
81    - name: 'Build CPython and measure coverage'
82      run: xvfb-run make -j4 coverage-report
83    - name: 'Publish code coverage results'
84      if: always()
85      run: |
86        make pythoninfo
87        bash <(curl -s https://codecov.io/bash)
88      env:
89        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
90