Skip to content

Commit

Permalink
Add GHA workflow to run check_datasets_xml on push
Browse files Browse the repository at this point in the history
  • Loading branch information
douglatornell committed Nov 6, 2023
1 parent b4cd13f commit 48ba1f3
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/check-datasets-xml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: check-datasets-xml

on:
push:
branches: [ '*' ]
# Enable workflow to be triggered from GitHub CLI, browser, or via API
# primarily for testing conda env solution for new Python versions
workflow_dispatch:

jobs:
check-datasets-xml:
permissions:
contents: read
pull-requests: write
strategy:
fail-fast: false
matrix:
python-version: [ '3.12' ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Conda environment with Micromamba
uses: mamba-org/setup-micromamba@54d4d5980e1a4aa7cdc8b050cf2d19b7e262ce18
with:
environment-file: envs/environment-test.yaml
environment-name: erddap-datasets-test
cache-environment: true
cache-downloads: true
# persist downloads cache for 1 day
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ inputs.python-version }}
- name: Run check_datasets_xml.py
run: python check_datasets_xml.py
22 changes: 22 additions & 0 deletions envs/environment-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# conda environment description file for Serddap-datasets testing environment
#
# Creates a conda environment in which the check_datasets_xml module can be run.
# Primarily intended for creation of a conda env for use in a GitHub Actions workflow.

name: erddap-datasets-test

channels:
- conda-forge
- nodefaults

dependencies:
- bottleneck
- jupyterlab
- lxml
- netcdf4
- pip
- python=3.12
- pyyaml
- rich
- structlog
- xarray

0 comments on commit 48ba1f3

Please sign in to comment.