Build openfl container image #124
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
--- | |
# Workflow functional E2E tests | |
name: Workflow_Functional_E2E | |
on: | |
pull_request: | |
branches: [ develop ] | |
types: [opened, synchronize, reopened, ready_for_review] | |
workflow_dispatch: | |
inputs: | |
num_rounds: | |
description: "Number of rounds to train" | |
required: false | |
default: "2" | |
type: string | |
num_collaborators: | |
description: "Number of collaborators" | |
required: false | |
default: "2" | |
type: string | |
permissions: | |
contents: read | |
# Environment variables common for all the jobs | |
env: | |
NUM_ROUNDS: ${{ github.event.inputs.num_rounds || '2' }} | |
NUM_COLLABORATORS: ${{ github.event.inputs.num_collaborators || '2' }} | |
jobs: | |
test_wf_func: | |
if: github.event.pull_request.draft == false | |
name: wf_func | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
python_version: ["3.10"] | |
fail-fast: false # do not immediately fail if one of the combinations fail | |
steps: | |
- name: Checkout OpenFL repository | |
id: checkout_openfl | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 2 # needed for detecting changes | |
submodules: "true" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
id: setup_python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Install dependencies | |
id: install_dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
pip install -r test-requirements.txt | |
pip install -r openfl-tutorials/experimental/workflow/workflow_interface_requirements.txt | |
- name: Run Work Flow Functional tests | |
id: run_tests | |
run: | | |
python -m pytest -s tests/end_to_end/test_suites/wf_local_func_tests.py \ | |
--num_rounds ${{ env.NUM_ROUNDS }} --num_collaborators ${{ env.NUM_COLLABORATORS }} | |
echo "Work Flow Functional tests run completed" | |
- name: Print test summary | |
id: print_test_summary | |
if: ${{ always() }} | |
run: | | |
export PYTHONPATH="$PYTHONPATH:." | |
python tests/end_to_end/utils/summary_helper.py | |
echo "Test summary printed" | |
- name: Create Tar (exclude cert and data folders) | |
id: tar_files | |
if: ${{ always() }} | |
run: | | |
tar -cvf result.tar --exclude="cert" --exclude="data" --exclude="__pycache__" $HOME/results | |
- name: Upload Artifacts | |
id: upload_artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: wf_func_${{ github.event.inputs.model_name || 'default_model' }}_python${{ matrix.python_version }}_${{ github.run_id }} | |
path: result.tar |