Add cuda workflow to test cuda developments on CI #121
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: Anaconda-Windows | |
on: | |
workflow_dispatch: | |
inputs: | |
python_version: | |
required: true | |
type: string | |
ref: | |
required: false | |
type: string | |
check_run_id: | |
required: false | |
type: string | |
pr_repo: | |
required: false | |
type: string | |
push: | |
branches: [devel, main] | |
env: | |
COMMIT: ${{ inputs.ref || github.event.ref }} | |
PEM: ${{ secrets.BOT_PEM }} | |
GITHUB_RUN_ID: ${{ github.run_id }} | |
GITHUB_CHECK_RUN_ID: ${{ inputs.check_run_id }} | |
PR_REPO: ${{ inputs.pr_repo || github.repository }} | |
jobs: | |
Python_version_picker: | |
runs-on: windows-latest | |
if: github.event_name != 'push' || github.repository == 'pyccel/pyccel-cuda' | |
outputs: | |
python_version: ${{ steps.set-python_version.outputs.python_version }} | |
steps: | |
- if: github.event_name == 'push' | |
run: | | |
echo "version=3.9" >> $GITHUB_ENV | |
shell: bash | |
- id: dispatch-matrix | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
echo "version=${{ inputs.python_version }}" >> $GITHUB_ENV | |
shell: bash | |
- id: set-python_version | |
run: | | |
echo "python_version=$version" >> $GITHUB_OUTPUT | |
shell: bash | |
Anaconda-Windows: | |
runs-on: windows-latest | |
name: Unit tests | |
needs: Python_version_picker | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.COMMIT }} | |
repository: ${{ env.PR_REPO }} | |
submodules: true | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
auto-activate-base: true | |
python-version: ${{ needs.Python_version_picker.outputs.python_version }} | |
- name: Install dependencies | |
uses: ./.github/actions/windows_install | |
- name: Install python dependencies | |
uses: ./.github/actions/conda_installation | |
with: | |
mpi_type: msmpi | |
- name: "Setup" | |
if: github.event_name != 'push' | |
id: token | |
run: | | |
python -m pip install jwt requests | |
python ci_tools/setup_check_run.py anaconda_windows | |
shell: bash -l -eo pipefail {0} | |
- name: Fortran/C tests with pytest | |
id: f_c_pytest | |
timeout-minutes: 60 | |
uses: ./.github/actions/pytest_run | |
with: | |
shell_cmd: 'bash -l -eo pipefail {0}' | |
pytest_mark: 'and not external' | |
- name: Python tests with pytest | |
id: python_pytest | |
timeout-minutes: 20 | |
uses: ./.github/actions/pytest_run_python | |
with: | |
shell_cmd: 'bash -l -eo pipefail {0}' | |
- name: "Post completed" | |
if: always() && github.event_name != 'push' | |
run: | | |
which python | |
python --version | |
python ci_tools/complete_check_run.py ${{ steps.f_c_pytest.outcome }} ${{ steps.python_pytest.outcome }} | |
shell: bash -l -eo pipefail {0} |