diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml new file mode 100644 index 0000000000..36dd56efc1 --- /dev/null +++ b/.github/workflows/build-reusable.yml @@ -0,0 +1,141 @@ +name: Build and test reusable workflow +run-name: ${{ inputs.run_name }} - ${{ inputs.python_version }} - ${{ inputs.runner_label || 'default'}} + +on: + workflow_call: + inputs: + device: + description: Device + type: string + default: max1100 + python_version: + description: Python version + type: string + required: true + run_name: + description: Custom run name + type: string + default: Build and test + use_pyenv_python: + description: Use Python built with pyenv + type: boolean + default: false + +permissions: read-all + +env: + PYTHON_VERSION: "3.10" + BENCHMARKING_METHOD: ${{ inputs.benchmarking_method || 'UPSTREAM_PYTORCH_PROFILER' }} + VERIFY: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule' || inputs.verify) && '1' || '0' }} + TAG: ${{ inputs.tag || (github.event_name == 'pull_request' && format('pr-{0}', github.event.number)) || (github.event_name == 'schedule' && 'ci') || 'test' }} + + +jobs: + build: + name: build + runs-on: Linux + defaults: + run: + shell: bash -noprofile --norc -eo pipefail -c "source /opt/intel/oneapi/setvars.sh > /dev/null; source {0}" + steps: + - name: Print inputs + run: | + cat <