diff --git a/.github/ci-config.yml b/.github/ci-config.yml new file mode 100644 index 0000000..5eb7e51 --- /dev/null +++ b/.github/ci-config.yml @@ -0,0 +1,9 @@ +# dependency_cmake_options: | +# ecmwf/ecflow: "-DENABLE_ALL_TESTS=ON -DBOOST_ROOT=${BOOST_ROOT_DIR} -DBOOST_INCLUDEDIR=${BOOST_INCLUDE_DIR} -DBOOST_LIBRARYDIR=${BOOST_LIB_DIR} -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} -DENABLE_STATIC_BOOST_LIBS=OFF" +dependencies: | + ecmwf/ecbuild + ecmwf/ecflow + ecmwf/pyflow +dependency_branch: develop +parallelism_factor: 8 +self_build: false # Only for python packages diff --git a/.github/ci-hpc-config.yml b/.github/ci-hpc-config.yml new file mode 100644 index 0000000..5627be2 --- /dev/null +++ b/.github/ci-hpc-config.yml @@ -0,0 +1,11 @@ +build: + modules: + - boost + - ninja + - python3 + - qt + dependencies: + - ecmwf/ecbuild@develop + - ecmwf/ecflow@develop + - ecmwf/pyflow@develop + parallel: 64 \ No newline at end of file diff --git a/.github/workflows/ci-legacy.yml b/.github/workflows/ci-legacy.yml new file mode 100644 index 0000000..9c17f66 --- /dev/null +++ b/.github/workflows/ci-legacy.yml @@ -0,0 +1,60 @@ +name: ci-wellies + +# Controls when the workflow will run +on: + push: + branches: [ "main", "develop" ] + pull_request: + branches: [ "main", "develop" ] + +jobs: + qa: + name: qa + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - run: pip install flake8 isort[pyproject] + - run: isort --check . + - run: flake8 . + + setup: + name: setup + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - run: python -m pip install . + + test: + name: pytest + env: + GIT_PYTHON_TRACE: 1 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: wellies-test + mamba-version: "*" + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + - run: git config --global user.email "dummy.user@ecmwf.int" + - run: git config --global user.name "Dummy User" + - name: Conda check + shell: bash -l {0} + run: | + conda info + conda list + - name: Install wellies and run tests + shell: bash -l {0} # required to load conda I think + run: | + python -m pip install .[test] + pytest . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c17f66..838991b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,60 +1,40 @@ -name: ci-wellies +name: ci -# Controls when the workflow will run on: + # Trigger the workflow on push to master or develop, except tag creation push: - branches: [ "main", "develop" ] - pull_request: - branches: [ "main", "develop" ] + branches: + - 'master' + - 'develop' + tags-ignore: + - '**' -jobs: - qa: - name: qa - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" + # Trigger the workflow on pull request + pull_request: ~ + + # Trigger the workflow manually + workflow_dispatch: ~ - - run: pip install flake8 isort[pyproject] - - run: isort --check . - - run: flake8 . + # Trigger after public PR approved for CI + pull_request_target: + types: [labeled] + +jobs: + # Run CI including downstream packages on self-hosted runners + downstream-ci: + name: downstream-ci + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} + uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@feature/pyflow + with: + pyflow-wellies: ecmwf/pyflow-wellies@${{ github.event.pull_request.head.sha || github.sha }} + python_qa: true + secrets: inherit - setup: - name: setup - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - run: python -m pip install . - - test: - name: pytest - env: - GIT_PYTHON_TRACE: 1 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: wellies-test - mamba-version: "*" - auto-update-conda: true - environment-file: environment.yml - auto-activate-base: false - - run: git config --global user.email "dummy.user@ecmwf.int" - - run: git config --global user.name "Dummy User" - - name: Conda check - shell: bash -l {0} - run: | - conda info - conda list - - name: Install wellies and run tests - shell: bash -l {0} # required to load conda I think - run: | - python -m pip install .[test] - pytest . + # Build downstream packages on HPC + downstream-ci-hpc: + name: downstream-ci-hpc + if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} + uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@feature/pyflow + with: + pyflow-wellies: ecmwf/pyflow-wellies@${{ github.event.pull_request.head.sha || github.sha }} + secrets: inherit \ No newline at end of file