diff --git a/.github/ci-config.yml b/.github/ci-config.yml new file mode 100644 index 00000000..004e8ab6 --- /dev/null +++ b/.github/ci-config.yml @@ -0,0 +1,5 @@ +dependencies: | + ecmwf/ecbuild + ecmwf/eckit +dependency_branch: develop +parallelism_factor: 8 diff --git a/.github/ci-hpc-config.yml b/.github/ci-hpc-config.yml new file mode 100644 index 00000000..76994016 --- /dev/null +++ b/.github/ci-hpc-config.yml @@ -0,0 +1,7 @@ +build: + modules: + - ninja + dependencies: + - ecmwf/ecbuild@develop + - ecmwf/eckit@develop + parallel: 64 diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..ef99a217 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,11 @@ +name: cd + +on: + push: + tags: + - '**' + +jobs: + deploy: + uses: ecmwf-actions/reusable-workflows/.github/workflows/create-package.yml@v2 + secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ba8966c..c50ce5d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,36 +1,40 @@ name: ci -# Controls when the workflow will run on: - - # Trigger the workflow on all pushes, except on tag creation + # Trigger the workflow on push to master or develop, except tag creation push: branches: - - '**' + - 'master' + - 'develop' tags-ignore: - - '**' + - '**' - # Trigger the workflow on all pull requests + # Trigger the workflow on pull request pull_request: ~ - # Allow workflow to be dispatched on demand + # Trigger the workflow manually workflow_dispatch: ~ -jobs: + # Trigger after public PR approved for CI + pull_request_target: + types: [labeled] - # Calls a reusable CI workflow to build & test the current repository. - # It will pull in all needed dependencies and produce a code coverage report on success. - ci: - name: ci - uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v1 +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@main with: + odc: ecmwf/odc@${{ github.event.pull_request.head.sha || github.sha }} codecov_upload: true - notify_teams: true - build_package_inputs: | - self_coverage: true - dependencies: | - ecmwf/ecbuild - ecmwf/eckit - dependency_branch: develop - secrets: - incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} + secrets: inherit + + # 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@main + with: + odc: ecmwf/odc@${{ github.event.pull_request.head.sha || github.sha }} + secrets: inherit diff --git a/.github/workflows/label-public-pr.yml b/.github/workflows/label-public-pr.yml new file mode 100644 index 00000000..59b2bfa2 --- /dev/null +++ b/.github/workflows/label-public-pr.yml @@ -0,0 +1,10 @@ +# Manage labels of pull requests that originate from forks +name: label-public-pr + +on: + pull_request_target: + types: [opened, synchronize] + +jobs: + label: + uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2 diff --git a/.github/workflows/notify-new-issue.yml b/.github/workflows/notify-new-issue.yml new file mode 100644 index 00000000..384a3570 --- /dev/null +++ b/.github/workflows/notify-new-issue.yml @@ -0,0 +1,15 @@ +name: Notify new issue + +on: + issues: + types: + - "opened" + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Notify new issue + uses: ecmwf-actions/notify-teams-issue@v1 + with: + incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} diff --git a/.github/workflows/notify-new-pr.yml b/.github/workflows/notify-new-pr.yml new file mode 100644 index 00000000..911970e8 --- /dev/null +++ b/.github/workflows/notify-new-pr.yml @@ -0,0 +1,15 @@ +name: Notify new PR + +on: + pull_request: + types: + - "opened" + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Notify new PR + uses: ecmwf-actions/notify-teams-pr@v1 + with: + incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 00000000..3deffa3b --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,24 @@ +name: sync + +# Controls when the workflow will run +on: + # Trigger the workflow on all pushes + push: + branches: + - "**" + tags: + - "**" + + # Trigger the workflow when a branch or tag is deleted + delete: ~ + +jobs: + # Calls a reusable CI workflow to sync the current with a remote repository. + # It will correctly handle addition of any new and removal of existing Git objects. + sync: + name: sync + uses: ecmwf-actions/reusable-workflows/.github/workflows/sync.yml@v2 + secrets: + target_repository: odb/odc + target_username: ClonedDuck + target_token: ${{ secrets.BITBUCKET_PAT }} diff --git a/CMakeLists.txt b/CMakeLists.txt index b62225e3..14d2ed10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ find_package( ecbuild 3.4 REQUIRED HINTS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CUR project( odc LANGUAGES C CXX ) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ######################################################################################################################## diff --git a/VERSION b/VERSION index c514bd85..bc80560f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.6 +1.5.0 diff --git a/src/fortran/legacy_fortran_api_examples.f90 b/src/fortran/legacy_fortran_api_examples.f90 index 23f29deb..784a9e24 100644 --- a/src/fortran/legacy_fortran_api_examples.f90 +++ b/src/fortran/legacy_fortran_api_examples.f90 @@ -94,7 +94,7 @@ subroutine example_fortran_api_append one_row(offsets(1)) = i one_row(offsets(2)) = i one_row(offsets(3)) = 5 - one_row(offsets(4):offsets(4)+3) = transfer(wigos, one_row(offsets(4):offsets(4)+3)) + one_row(offsets(4):offsets(4)+3) = transfer(wigos(1:32), one_row(offsets(4):offsets(4)+3)) one_row(offsets(5)) = transfer(expver, one_row(5)) one_row(offsets(6)) = 5 cerr = odb_write_set_next_row(odb_it, one_row, c_ncolumns) @@ -135,7 +135,7 @@ subroutine example_fortran_api_append one_row(offsets(1)) = i one_row(offsets(2)) = i one_row(offsets(3)) = 5 - one_row(offsets(4):offsets(4)+3) = transfer(wigos, one_row(offsets(4):offsets(4)+3)) + one_row(offsets(4):offsets(4)+3) = transfer(wigos(1:32), one_row(offsets(4):offsets(4)+3)) one_row(offsets(5)) = transfer(expver, one_row(5)) one_row(offsets(6)) = 5 cerr = odb_write_set_next_row(odb_it, one_row, c_ncolumns) @@ -197,7 +197,7 @@ subroutine example_fortran_api_setup one_row(offsets(1)) = i one_row(offsets(2)) = i one_row(offsets(3)) = 5 - one_row(offsets(4):offsets(4)+3) = transfer(wigos, one_row(offsets(4):offsets(4)+3)) + one_row(offsets(4):offsets(4)+3) = transfer(wigos(1:32), one_row(offsets(4):offsets(4)+3)) one_row(offsets(5)) = transfer(expver, one_row(5)) one_row(offsets(6)) = 5 cerr = odb_write_set_next_row(odb_it, one_row, c_ncolumns) diff --git a/src/odc/api/StridedData.h b/src/odc/api/StridedData.h index b2dd2931..f139167c 100644 --- a/src/odc/api/StridedData.h +++ b/src/odc/api/StridedData.h @@ -15,7 +15,7 @@ #ifndef odc_api_StridedData_H #define odc_api_StridedData_H -#include +#include #include #include