Skip to content

Commit

Permalink
Merge pull request #2446 from oliver-sanders/beta
Browse files Browse the repository at this point in the history
beta
  • Loading branch information
wxtim authored Mar 26, 2021
2 parents 59c2f6c + 3b834a8 commit 0bd0424
Show file tree
Hide file tree
Showing 718 changed files with 4,537 additions and 21,031 deletions.
33 changes: 33 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright (C) NIWA & British Crown (Met Office) & Contributors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

module.exports = {
root: true,
env: {
browser: true
},
extends: [
'standard',
'eslint:recommended'
],
rules: {
'operator-linebreak': ['error', 'before']
},
globals: {
'$': 'readonly'
}
}
11 changes: 0 additions & 11 deletions .eslintrc.json

This file was deleted.

227 changes: 227 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
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

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']
# TODO: re-enable macos testing
# currently (in the absence of a wrapper script) rose cannot be run
# from within cylc jobs in situations where the output of the following
# commands differ:
# bash -c 'which python'
# bash -l -c 'which python'
# 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
# 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
- name: MacOS DNS Patch
if: startsWith(matrix.os, 'macos')
run: |
# apply DNS patch
hostuserutil="$(python3 -c '
import cylc.flow.hostuserutil
print(cylc.flow.hostuserutil.__file__)
')"
patch "${hostuserutil}" < rose/etc/conf/macos-patch
- name: Install Rose
working-directory: rose
run: |
pip install ."[all]"
pip install --no-deps 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: 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
pip install pygraphviz
- name: install
run: |
pip install -e .[docs]
- 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
*.swp
etc/rose.conf
etc/opt
lib/bash/rose_init_site
doc
venv
metomi_rose.egg-info
dist
node_modules

# coverage
.coverage
Expand Down
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .travis/cover.py

This file was deleted.

Loading

0 comments on commit 0bd0424

Please sign in to comment.