|
| 1 | +# Do not edit this YAML file. This file is generated automatically by executing |
| 2 | +# python scripts/split_tox_gh_actions/split_tox_gh_actions.py |
| 3 | +# The template responsible for it is in |
| 4 | +# scripts/split_tox_gh_actions/templates/base.jinja |
| 5 | +name: Test Flags |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + - release/** |
| 11 | + - potel-base |
| 12 | + pull_request: |
| 13 | +# Cancel in progress workflows on pull_requests. |
| 14 | +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 17 | + cancel-in-progress: true |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | +env: |
| 21 | + BUILD_CACHE_KEY: ${{ github.sha }} |
| 22 | + CACHED_BUILD_PATHS: | |
| 23 | + ${{ github.workspace }}/dist-serverless |
| 24 | +jobs: |
| 25 | + test-flags-latest: |
| 26 | + name: Flags (latest) |
| 27 | + timeout-minutes: 30 |
| 28 | + runs-on: ${{ matrix.os }} |
| 29 | + strategy: |
| 30 | + fail-fast: false |
| 31 | + matrix: |
| 32 | + python-version: ["3.8","3.12","3.13"] |
| 33 | + # python3.6 reached EOL and is no longer being supported on |
| 34 | + # new versions of hosted runners on Github Actions |
| 35 | + # ubuntu-20.04 is the last version that supported python3.6 |
| 36 | + # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 |
| 37 | + os: [ubuntu-20.04] |
| 38 | + steps: |
| 39 | + |
| 40 | + - uses: actions/setup-python@v5 |
| 41 | + with: |
| 42 | + python-version: ${{ matrix.python-version }} |
| 43 | + allow-prereleases: true |
| 44 | + - name: Setup Test Env |
| 45 | + run: | |
| 46 | + pip install "coverage[toml]" tox |
| 47 | + - name: Erase coverage |
| 48 | + run: | |
| 49 | + coverage erase |
| 50 | + - name: Test launchdarkly latest |
| 51 | + run: | |
| 52 | + set -x # print commands that are executed |
| 53 | + ./scripts/runtox.sh "py${{ matrix.python-version }}-launchdarkly-latest" |
| 54 | + - name: Test openfeature latest |
| 55 | + run: | |
| 56 | + set -x # print commands that are executed |
| 57 | + ./scripts/runtox.sh "py${{ matrix.python-version }}-openfeature-latest" |
| 58 | + - name: Test unleash latest |
| 59 | + run: | |
| 60 | + set -x # print commands that are executed |
| 61 | + ./scripts/runtox.sh "py${{ matrix.python-version }}-unleash-latest" |
| 62 | + - name: Generate coverage XML (Python 3.6) |
| 63 | + if: ${{ !cancelled() && matrix.python-version == '3.6' }} |
| 64 | + run: | |
| 65 | + export COVERAGE_RCFILE=.coveragerc36 |
| 66 | + coverage combine .coverage-sentry-* |
| 67 | + coverage xml --ignore-errors |
| 68 | + - name: Generate coverage XML |
| 69 | + if: ${{ !cancelled() && matrix.python-version != '3.6' }} |
| 70 | + run: | |
| 71 | + coverage combine .coverage-sentry-* |
| 72 | + coverage xml |
| 73 | + - name: Upload coverage to Codecov |
| 74 | + if: ${{ !cancelled() }} |
| 75 | + |
| 76 | + with: |
| 77 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 78 | + files: coverage.xml |
| 79 | + # make sure no plugins alter our coverage reports |
| 80 | + plugin: noop |
| 81 | + verbose: true |
| 82 | + - name: Upload test results to Codecov |
| 83 | + if: ${{ !cancelled() }} |
| 84 | + uses: codecov/test-results-action@v1 |
| 85 | + with: |
| 86 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 87 | + files: .junitxml |
| 88 | + verbose: true |
| 89 | + test-flags-pinned: |
| 90 | + name: Flags (pinned) |
| 91 | + timeout-minutes: 30 |
| 92 | + runs-on: ${{ matrix.os }} |
| 93 | + strategy: |
| 94 | + fail-fast: false |
| 95 | + matrix: |
| 96 | + python-version: ["3.8","3.12","3.13"] |
| 97 | + # python3.6 reached EOL and is no longer being supported on |
| 98 | + # new versions of hosted runners on Github Actions |
| 99 | + # ubuntu-20.04 is the last version that supported python3.6 |
| 100 | + # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 |
| 101 | + os: [ubuntu-20.04] |
| 102 | + steps: |
| 103 | + |
| 104 | + - uses: actions/setup-python@v5 |
| 105 | + with: |
| 106 | + python-version: ${{ matrix.python-version }} |
| 107 | + allow-prereleases: true |
| 108 | + - name: Setup Test Env |
| 109 | + run: | |
| 110 | + pip install "coverage[toml]" tox |
| 111 | + - name: Erase coverage |
| 112 | + run: | |
| 113 | + coverage erase |
| 114 | + - name: Test launchdarkly pinned |
| 115 | + run: | |
| 116 | + set -x # print commands that are executed |
| 117 | + ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-launchdarkly" |
| 118 | + - name: Test openfeature pinned |
| 119 | + run: | |
| 120 | + set -x # print commands that are executed |
| 121 | + ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openfeature" |
| 122 | + - name: Test unleash pinned |
| 123 | + run: | |
| 124 | + set -x # print commands that are executed |
| 125 | + ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-unleash" |
| 126 | + - name: Generate coverage XML (Python 3.6) |
| 127 | + if: ${{ !cancelled() && matrix.python-version == '3.6' }} |
| 128 | + run: | |
| 129 | + export COVERAGE_RCFILE=.coveragerc36 |
| 130 | + coverage combine .coverage-sentry-* |
| 131 | + coverage xml --ignore-errors |
| 132 | + - name: Generate coverage XML |
| 133 | + if: ${{ !cancelled() && matrix.python-version != '3.6' }} |
| 134 | + run: | |
| 135 | + coverage combine .coverage-sentry-* |
| 136 | + coverage xml |
| 137 | + - name: Upload coverage to Codecov |
| 138 | + if: ${{ !cancelled() }} |
| 139 | + |
| 140 | + with: |
| 141 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 142 | + files: coverage.xml |
| 143 | + # make sure no plugins alter our coverage reports |
| 144 | + plugin: noop |
| 145 | + verbose: true |
| 146 | + - name: Upload test results to Codecov |
| 147 | + if: ${{ !cancelled() }} |
| 148 | + uses: codecov/test-results-action@v1 |
| 149 | + with: |
| 150 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 151 | + files: .junitxml |
| 152 | + verbose: true |
| 153 | + check_required_tests: |
| 154 | + name: All pinned Flags tests passed |
| 155 | + needs: test-flags-pinned |
| 156 | + # Always run this, even if a dependent job failed |
| 157 | + if: always() |
| 158 | + runs-on: ubuntu-20.04 |
| 159 | + steps: |
| 160 | + - name: Check for failures |
| 161 | + if: contains(needs.test-flags-pinned.result, 'failure') || contains(needs.test-flags-pinned.result, 'skipped') |
| 162 | + run: | |
| 163 | + echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 |
0 commit comments