Update continuous_integration.yml #51
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
# Workflow for continuous integration tests | ||
name: Continuous integration gfortran compilers | ||
on: [push, pull_request, workflow_dispatch] | ||
jobs: | ||
# This workflow contains a single job called "ci_gfortran" | ||
ci_gfortran: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.11] | ||
# Sequence of tasks that will be executed as part of the job | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
env: | ||
GDKGO1: https://docs.google.com/uc?export=download&id=11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq | ||
GDKGO2: https://docs.google.com/uc?export=download&id=1s5Ha6Hqnv_hWbRUs8KQpJ4Lxy8uvJDar | ||
GDKGO3: https://docs.google.com/uc?export=download&id=1kY1lRgzd0UhDiQef2u-VgTQql_iut3U2 | ||
steps: | ||
############################################################################### | ||
# Initial steps | ||
############################################################################### | ||
# Checks-out repository under $GITHUB_WORKSPACE | ||
- uses: actions/checkout@v4 | ||
- name: List dirs | ||
run: | | ||
pwd | ||
ls | ||
- name: Setup conda environment | ||
uses: conda-incubator/[email protected] | ||
with: | ||
auto-update-conda: true | ||
activate-environment: cienv | ||
environment-file: etc/environment.yml | ||
python-version: ${{ matrix.python-version }} | ||
auto-activate-base: false | ||
- name: Environment info | ||
run: | | ||
conda info | ||
############################################################################### | ||
# Retrieve files and run tests | ||
############################################################################### | ||
- name: Retrieve input files | ||
run: | | ||
cd ${GITHUB_WORKSPACE} | ||
OUTPATH=driver/data/outputs/kgo1.nc.gz | ||
curl -sSfL -o $OUTPATH $GDKGO1 | ||
gunzip ${OUTPATH} | ||
cd driver/data/outputs | ||
ls -lh | ||
- id: google-token | ||
uses: playeveryware/[email protected] | ||
with: | ||
credentials: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_CREDENTIALS }} | ||
scope: 'https://www.googleapis.com/auth/drive.readonly' | ||
- name: Show (masked) token | ||
run: | | ||
echo "Masked token ${{ steps.google-token.outputs.token }}" | ||
# - name: Acquire Google access token | ||
# id: google-access-token | ||
# uses: playeveryware/action-google-access-token@v1 | ||
# with: | ||
# credentials: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_CREDENTIALS }} | ||
# scope: 'https://www.googleapis.com/auth/drive.readonly' | ||
- name: Download file | ||
uses: playeveryware/[email protected] | ||
with: | ||
token: ${{ steps.google-access-token.outputs.token }} | ||
file-id: 11dKcIL3EQr7s6jbo4f9GsoW0SufesGbq | ||
path: driver/data/outputs/kgo2.nc.gz | ||
- name: Unzip and list downloaded files | ||
run: | | ||
cd ${GITHUB_WORKSPACE} | ||
gunzip driver/data/outputs/kgo1.nc.gz | ||
gunzip driver/data/outputs/kgo2.nc.gz | ||
ls -lh driver/data/outputs | ||
- name: Test python environment | ||
run: | | ||
cd driver | ||
python test.py |