Skip to content

Updating CI

Updating CI #997

Workflow file for this run

name: Continuous Integration
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
# run this every week at 12 noon on Monday
- cron: '0 12 * * 1'
env:
EXAMPLE_DATA_FILE_VERSION: v3
jobs:
# Run a download step first so that it is in
# the cache, because all the other jobs will be running
# at the same time and so might miss it.
Download_Data:
runs-on: ubuntu-latest
steps:
- name: Cache example data
id: cache-example
uses: actions/cache@v3
env:
cache-name: cache-example-data
with:
path: example.tar.gz
# update this when we change package contents and want
# to force an update
key: example-data-${{ env.EXAMPLE_DATA_FILE_VERSION }}
- name: Download test data
if: steps.cache-example.outputs.cache-hit != 'true'
run: |
wget -O example.tar.gz "https://portal.nersc.gov/cfs/lsst/txpipe/data/example.tar.gz"
Run_Installer:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
include:
- os: ubuntu-latest
INSTALL_DEPS: sudo apt-get update && sudo apt-get -y install wget
- os: macos-14
INSTALL_DEPS: brew update-reset && brew install wget
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install wget
run: |
${{ matrix.INSTALL_DEPS }}
- name: Cache conda environment
id: cache-conda
uses: actions/cache@v4
env:
cache-name: cache-conda-environment
with:
path: ./conda
key: ${{ matrix.os }}-conda-${{ hashFiles('bin/install.sh','environment*.yml' ) }}
fail-on-cache-miss: false
- name: Run installer
if: steps.cache-conda.outputs.cache-hit != 'true'
run: |
./bin/install.sh
Unit_Tests:
runs-on: ${{ matrix.os }}
needs: Run_Installer
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
include:
- os: ubuntu-latest
INSTALL_DEPS: sudo apt-get update && sudo apt-get -y install wget
- os: macos-14
INSTALL_DEPS: brew update-reset && brew install --cask basictex && brew install wget && eval "$(/usr/libexec/path_helper)" && pdflatex --version
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: ${{ matrix.INSTALL_DEPS }}
- name: Restore conda environment
id: restore-conda
uses: actions/cache@v4
env:
cache-name: cache-conda-environment
with:
path: ./conda
key: ${{ matrix.os }}-conda-${{ hashFiles('bin/install.sh','environment*.yml' ) }}
fail-on-cache-miss: true
- name: Test with pytest
run: |
source conda/bin/activate
ceci --version
pytest txpipe
# Metadetect:
# runs-on: ${{ matrix.os }}
# needs: Run_Installer
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-14]
# test: [metadetect]
# include:
# - os: ubuntu-latest
# INSTALL_DEPS: sudo apt-get update && sudo apt-get -y install wget
# - os: macos-14
# INSTALL_DEPS: brew update-reset && brew install --cask basictex && brew install wget && eval "$(/usr/libexec/path_helper)" && pdflatex --version
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# with:
# submodules: true
# - name: Install dependencies
# run: |
# ${{ matrix.INSTALL_DEPS }}
# - name: Restore conda environment
# id: restore-conda
# uses: actions/cache@v4
# env:
# cache-name: cache-conda-environment
# with:
# path: ./conda
# key: ${{ matrix.os }}-conda-${{ hashFiles('bin/install.sh','environment*.yml' ) }}
# fail-on-cache-miss: true
# - name: Restore example data
# uses: actions/cache/restore@v3
# with:
# path: example.tar.gz
# key: example-data-${{ env.EXAMPLE_DATA_FILE_VERSION }}
# fail-on-cache-miss: true
# - name: Extract test data
# run: |
# tar -zxvf example.tar.gz
# - name: Run pipeline
# run: |
# mkdir -p cache/workspaces
# source ./conda/bin/activate
# ceci examples/${{ matrix.test }}/pipeline.yml