Add --code flag for collecting code context. #2484
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Tests | |
on: [pull_request] | |
jobs: | |
is_source_changed: | |
name: Check if sources has changed | |
runs-on: ubuntu-22.04 | |
outputs: | |
is_source_changed: ${{steps.check_source_change.outputs.changed}} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
fetch-depth: 0 | |
- name: Check if any source changed | |
id: check_source_change | |
uses: ./.github/actions/files-changed | |
with: | |
paths: | | |
.github/* | |
examples/* | |
testplan/* | |
tests/* | |
scripts/* | |
releaseherald/releaseherald/* | |
pytest.ini | |
pyproject.toml | |
setup.py | |
requirements.txt | |
success: | |
name: PR Test Completed | |
needs: [is_source_changed, test] | |
runs-on: ubuntu-22.04 | |
if: always() && needs.is_source_changed.result == 'success' && (needs.is_source_changed.outputs.is_source_changed == 'false' || needs.Test.result == 'success') | |
steps: | |
- run: echo ${{needs.is_source_changed.result}} ${{needs.is_source_changed.outputs.is_source_changed}} ${{needs.Test.result}} | |
- run: true | |
lint_python: | |
name: Run lint on python code | |
needs: [is_source_changed] | |
runs-on: ubuntu-22.04 | |
if: needs.is_source_changed.outputs.is_source_changed == 'true' | |
env: | |
BLACK_VERSION: "22.10.0" | |
LINT_PYTHON_VERSION: "3.7" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Set up Python ${{ env.LINT_PYTHON_VERSION }} | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
with: | |
python-version: ${{ env.LINT_PYTHON_VERSION }} | |
- name: Restore pip cache | |
uses: ./.github/actions/pip-cache | |
- name: Setup | |
run: | | |
pip install -r requirements.txt -U | |
- name: Lint | |
run: doit lint | |
build_ui: | |
name: Build UI (with test and lint) | |
needs: [is_source_changed] | |
runs-on: ubuntu-22.04 | |
if: needs.is_source_changed.outputs.is_source_changed == 'true' | |
env: | |
REACT_APP_API_BASE_URL: "/fake/api/endpoint" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Set up Python | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
with: | |
python-version: 3.11 | |
- name: Set up Node | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version: "16.x" | |
- name: Restore pip cache | |
uses: ./.github/actions/pip-cache | |
- name: Set up PNPM | |
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | |
with: | |
version: 8.10.4 | |
- name: Setup | |
run: | | |
pip install -r requirements-build.txt -U | |
- name: Build | |
run: | | |
doit lint_ui | |
CI=false doit build_ui | |
doit test_ui | |
- name: Archive ui artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: ui_bundle | |
path: testplan/web_ui/testing/build | |
retention-days: 1 | |
test: | |
name: Test | |
needs: [lint_python, build_ui] | |
runs-on: ${{ matrix.os }} | |
env: | |
CI: "" | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-latest] | |
python-version: [3.7, 3.8, '3.10', 3.11] | |
fail-fast: false | |
steps: | |
- run: echo "BUILD ${{ matrix.os }} ${{ matrix.python-version }} ${{needs.is_source_changed.outputs.is_source_changed}}" | |
- name: Checkout repository | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Restore pip cache | |
uses: ./.github/actions/pip-cache | |
- name: Download ui bundle | |
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
with: | |
name: ui_bundle | |
path: testplan/web_ui/testing/build | |
- name: Set up Zookeeper for tests | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: sudo apt-get -y install zookeeper zookeeper-bin zookeeperd | |
- name: Set up Kafka for tests | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: | | |
wget https://archive.apache.org/dist/kafka/3.5.2/kafka_2.13-3.5.2.tgz -O kafka.tgz | |
sudo mkdir /opt/kafka | |
sudo chown -R $USER:$USER /opt/kafka | |
tar zxf kafka.tgz -C /opt/kafka --strip-components 1 | |
- name: Install dependencies | |
run: pip install -r requirements.txt -U | |
- name: Test Python | |
run: doit test |