Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 39 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
branches: [develop]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

env:
REPO: ${{ github.event.repository.name }}
BUNDLE: pr-${{ github.event.number }}
Expand All @@ -16,116 +20,118 @@ jobs:
name: gnu 11.3.1 (UKMO)
if: github.repository_owner == 'MetOffice'
runs-on: jedi-self-hosted-rg

steps:
- name: pre-submit cleanup
- name: Pre-submit cleanup
run: |
ls -la ./
rm -fr ./${{ env.BUNDLE }} || true
ls -la ./
- name: checkout current
ls -lgo ./
- name: Checkout current
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/${{ env.REPO }}
- name: initiate bundle
- name: Initiate bundle
run: cp ./${{ env.BUNDLE }}/${{ env.REPO }}/ci/* ./${{ env.BUNDLE }}/

- name: checkout jedicmake
- name: Checkout jedicmake
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/jedicmake
repository: JCSDA-internal/jedi-cmake
submodules: true
token: ${{ secrets.GH_PAT }}

- name: checkout oops
- name: Checkout oops
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/oops
repository: JCSDA-internal/oops
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt oops ${{ github.head_ref }}
- name: Checkout attempt for oops@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/oops

- name: checkout ioda
- name: Checkout ioda
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/ioda
repository: JCSDA-internal/ioda
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt ioda ${{ github.head_ref }}
- name: Checkout attempt for ioda@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/ioda

- name: checkout ufo
- name: Checkout ufo
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/ufo
repository: JCSDA-internal/ufo
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt ufo ${{ github.head_ref }}
- name: Checkout attempt for ufo@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/ufo

- name: build and test
- name: Build and Test
run: |
az acr login --name ngmssboxjediacr
docker run --rm \
--entrypoint=/usr/local/src/${REPO}/${BUNDLE}/build-and-test \
--workdir=/usr/local/src/${REPO}/${BUNDLE} \
--volume ${PWD}/${BUNDLE}:/usr/local/src/${REPO}/${BUNDLE} \
'ngmssboxjediacr.azurecr.io/jedibase:alma9' \
&& rm -fr ${{github.workspace}}/${{env.BUNDLE}}
'ngmssboxjediacr.azurecr.io/jedibase:alma9'

- name: Cleanup workspace
working-directory: ${{github.workspace}}
run: rm -fr ${{ env.BUNDLE }} || true

build2:
name: gnu 9.4.0 (JCSDA)
if: github.repository_owner == 'MetOffice'
runs-on: ubuntu-latest

steps:
- name: checkout current
- name: Checkout current
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/${{ env.REPO }}
- name: initiate bundle
run: cp ./${{ env.BUNDLE }}/${{ env.REPO }}/ci/* ./${{ env.BUNDLE }}/

- name: checkout jedicmake
- name: Checkout jedicmake
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/jedicmake
repository: JCSDA-internal/jedi-cmake
submodules: true
token: ${{ secrets.GH_PAT }}

- name: checkout oops
- name: Checkout oops
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/oops
repository: JCSDA-internal/oops
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt oops ${{ github.head_ref }}
- name: Checkout attempt for oops@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/oops

- name: checkout ioda
- name: Checkout ioda
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/ioda
repository: JCSDA-internal/ioda
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt ioda ${{ github.head_ref }}
- name: Checkout attempt for ioda@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/ioda

- name: checkout ufo
- name: Checkout ufo
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/ufo
repository: JCSDA-internal/ufo
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt ufo ${{ github.head_ref }}
- name: Checkout attempt for ufo@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/ufo

Expand All @@ -143,52 +149,52 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: checkout current
- name: Checkout current
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/${{ env.REPO }}
- name: initiate bundle
run: cp ./${{ env.BUNDLE }}/${{ env.REPO }}/ci/* ./${{ env.BUNDLE }}/

- name: checkout jedicmake
- name: Checkout jedicmake
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/jedicmake
repository: JCSDA-internal/jedi-cmake
submodules: true
token: ${{ secrets.GH_PAT }}

- name: checkout oops
- name: Checkout oops
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/oops
repository: JCSDA-internal/oops
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt oops ${{ github.head_ref }}
- name: Checkout attempt for oops@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/oops

- name: checkout ioda
- name: Checkout ioda
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/ioda
repository: JCSDA-internal/ioda
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt ioda ${{ github.head_ref }}
- name: Checkout attempt for ioda@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/ioda

- name: checkout ufo
- name: Checkout ufo
uses: actions/checkout@v4
with:
path: ./${{ env.BUNDLE }}/ufo
repository: JCSDA-internal/ufo
token: ${{ secrets.GH_PAT }}
- name: matching branch checkout attempt ufo ${{ github.head_ref }}
- name: Checkout attempt for ufo@${{ github.head_ref }}
if: github.event_name == 'pull_request'
run: ./${{ env.BUNDLE }}/get-ref-branch ./${{ env.BUNDLE }}/ufo

- name: build and test
- name: Build and Test
run: |
docker run --rm \
--entrypoint=/usr/local/src/${REPO}/${BUNDLE}/build-and-test \
Expand Down
2 changes: 2 additions & 0 deletions ci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project( opsinputs-ci VERSION 0.1 LANGUAGES C CXX Fortran )

set( ENABLE_MPI ON CACHE BOOL "Compile with MPI" )
set( ENABLE_OMP ON CACHE BOOL "Compile with OpenMP" )
option(ENABLE_IODA_DATA "Obtain ioda test data from ioda-data repository (vs tarball)" ON)
option(ENABLE_UFO_DATA "Obtain ufo test data from ufo-data repository (vs tarball)" ON)

add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/jedicmake")
if(NOT DEFINED jedicmake_DIR)
Expand Down
6 changes: 6 additions & 0 deletions ci/build-and-test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# (C) Crown Copyright 2023, the Met Office. All rights reserved.
#
# shellcheck disable=SC2317
# shellcheck source=/dev/null
set -euo pipefail

finally() {
Expand All @@ -11,6 +13,10 @@ finally() {
cd /
rm -fr "${WORKD}"
fi
if [[ -d ${BASE:-} ]]; then
cd /
rm -fr "$BASE" 2>/dev/null || true
fi
}

# -- HERE is /usr/local/src/<REPONAME>/pr-<#> (cf ../.github/workflow/ci.yml)
Expand Down
Loading