Skip to content

test

test #147

Workflow file for this run

name: test
on:
pull_request:
workflow_dispatch:
inputs:
rose_ref:
description: The Rose branch to test against
required: true
fcm_ref:
description: The FCM branch to test against
required: false
fcm_repo:
description: The FCM repo to test against
required: false
cylc_ref:
description: The Cylc branch to test against
required: false
cylc_repo:
description: The Cylc repo to test against
required: false
schedule:
- cron: '37 04 * * 1-5' # 03:37, Monday-Friday
defaults:
run:
shell: bash # macos default shell is zsh
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.7', '3.8', '3.9']
include:
- os: 'macos-latest'
python-version: '3.7'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.rose_ref || github.sha }}
path: rose
- name: Configure Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Cylc
env:
cylc_repo: ${{ github.event.inputs.cylc_repo || 'cylc/cylc-flow' }}
cylc_branch: ${{ github.event.inputs.cylc_ref || 'master' }}
run: |
pip install "git+https://github.com/${cylc_repo}@${cylc_branch}"
- name: Brew Install
if: startsWith(matrix.os, 'macos')
run: |
# install system deps
brew install \
bash \
coreutils \
gnu-sed \
shellcheck \
sqlite3 \
subversion \
graphviz
# add GNU coreutils and sed to the user PATH (for actions steps)
# (see instructions in brew install output)
echo \
"$(brew --prefix)/opt/coreutils/libexec/gnubin" \
>> "${GITHUB_PATH}"
echo \
"/usr/local/opt/gnu-sed/libexec/gnubin" \
>> "${GITHUB_PATH}"
# add GNU coreutils and sed to the user PATH (for Cylc jobs)
cat >> "$HOME/.bashrc" <<__HERE__
PATH="/usr/local/opt/coreutils/libexec/gnubin:\$PATH"
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:\$PATH"
PATH="$pythonLocation:\$PATH"
export PATH
# see NOTE in t/rosie-lookup/00-basic.t
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
__HERE__
cat "$HOME/.bashrc"
- name: Apt-Get Install
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y shellcheck sqlite3 at graphviz graphviz-dev
- name: Install Rose
working-directory: rose
run: |
pip install ."[all]"
pip install git+https://github.com/cylc/cylc-rose.git
yarn install
- name: Checkout FCM
if: startsWith(matrix.os, 'ubuntu')
uses: actions/checkout@v2
with:
repository: ${{ github.event.inputs.fcm_repo || 'metomi/fcm' }}
ref: ${{ github.event.inputs.fcm_ref || 'master' }}
path: 'fcm'
- name: Install FCM
if: startsWith(matrix.os, 'ubuntu')
run: |
# install FCM deps
sudo apt-get install -y \
subversion \
build-essential \
gfortran \
libxml-parser-perl \
libconfig-inifiles-perl \
libdbi-perl \
libdbd-sqlite3-perl
# install wandisco
sudo sh -c 'echo "deb http://opensource.wandisco.com/ubuntu \
`lsb_release -cs` svn19" \
>> /etc/apt/sources.list.d/subversion19.list'
sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- \
| sudo apt-key add -
# prepend FCM bin to $PATH
FCM_PATH="$GITHUB_WORKSPACE/fcm/bin"
# the github actions way (needed for cylc jobs)
echo "$FCM_PATH" >> "${GITHUB_PATH}"
# the bashrc wat (needed for subsequent gh action steps)
echo "export PATH=\"$FCM_PATH:\$PATH\"" >> "$HOME/.bashrc"
- name: Style
working-directory: rose
run: |
flake8
etc/bin/shellchecker
yarn run lint
- name: MyPy
working-directory: rose
run: |
mypy
- name: Unit Tests
working-directory: rose
run: |
pytest
- name: Functional Tests
timeout-minutes: 30
id: functest
working-directory: rose
env:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES
run: |
# rose tests should pass first time around
etc/bin/rose-test-battery -j 4 --state=save
- name: Re-Run Fails
if: failure() && steps.functest.outcome == 'failure'
working-directory: rose
env:
OBJC_DISABLE_INITIALIZE_FORK_SAFETY: YES
run: |
# so we only re-run for debug purposes
cylc scan --state=all --color=never
etc/bin/rose-test-battery -j 1 -v --state=save,failed
- name: Upload
if: failure() && steps.functest.outcome == 'failure'
uses: actions/upload-artifact@v2
with:
name: cylc-run ${{ matrix.os }}
path: ~/cylc-run/
docs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.rose_ref || github.sha }}
- name: Configure Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: install graphviz
run: |
sudo apt-get update
sudo apt-get install -y graphviz pkg-config libgraphviz-dev
- name: install
run: |
pip install -e .[docs,graph]
pip install git+https://github.com/cylc/cylc-flow.git
pip install git+https://github.com/cylc/cylc-rose.git
- name: build (html)
run: |
make -C sphinx/ html SPHINXOPTS='-Wn'
- name: build (slides)
run: |
make -C sphinx/ slides SPHINXOPTS='-Wn'
- name: build (linkcheck)
run: |
make -C sphinx/ linkcheck SPHINXOPTS='-Wn'
- name: debug
if: failure()
run: |
cat /tmp/sphinx-err* >&2 || true