run apps test on repo+branch #30
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: Test - Apps Standalone | |
on: | |
workflow_dispatch: | |
workflow_call: | |
# todo remove before merge | |
pull_request: | |
branches: | |
- main | |
jobs: | |
apps-test: | |
strategy: | |
max-parallel: 99 | |
matrix: | |
apps: | |
- ring@main | |
- tutorial-apps@basic_aggregator | |
- tutorial-apps@pretrained_model_aggregator | |
- tutorial-apps@pretrained_model_local | |
python-version: ["3.9"] | |
runner: [syftbox-sh-linux-x64, sh-macos-arm64] | |
fail-fast: false | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- name: Parse app repository info | |
id: apprepo | |
run: | | |
REPO=$(echo ${{ matrix.apps }} | cut -d'@' -f1) | |
REF=$(echo ${{ matrix.apps }} | cut -d'@' -f2) | |
echo "REPO=$REPO" >> $GITHUB_OUTPUT | |
echo "REF=$REF" >> $GITHUB_OUTPUT | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: OpenMined/${{ steps.apprepo.outputs.REPO }} | |
ref: ${{ steps.apprepo.outputs.REF }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: "0.4.25" | |
- name: Set up Python ${{ matrix.python-version }} | |
if: startsWith(matrix.runner, 'syftbox-sh-linux') | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# challenge here is actions/setup-python@v5 requires write access to /Users/runner/hostedtoolcache | |
# but current custom macos runner does not allow writing to that dir (even sudo won't work) | |
# so we need to use this weird way to install python on macos | |
- name: Set up Python ${{ matrix.python-version }} (uv managed) | |
if: startsWith(matrix.runner, 'sh-macos') | |
run: | | |
uv python install ${{ matrix.python-version }} | |
uv venv --python ${{ matrix.python-version }} .venv${{ matrix.python-version }} | |
uv tool update-shell | |
source $HOME/.profile | |
source .venv${{ matrix.python-version }}/bin/activate | |
- name: Provisioning dummy config | |
run: | | |
CONFIG_PATH="$(pwd)/config.json" | |
SYNC_FOLDER="$(pwd)/sync/" | |
echo '{ | |
"config_path": "'"$CONFIG_PATH"'", | |
"sync_folder": "'"$SYNC_FOLDER"'", | |
"port": 8011, | |
"email": "[email protected]", | |
"token": null, | |
"server_url": "http://localhost:5001", | |
"email_token": null, | |
"autorun_plugins": [ | |
"init", | |
"create_datasite", | |
"sync", | |
"apps" | |
] | |
}' > $CONFIG_PATH | |
cat $CONFIG_PATH | |
- name: Run the test | |
run: | | |
chmod +x ./run.sh | |
export SYFTBOX_CLIENT_CONFIG_PATH="$(pwd)/config.json" | |
sh ./run.sh |