Skip to content

Commit

Permalink
Merge pull request #442 from ReactionMechanismGenerator/gh_actions_ci
Browse files Browse the repository at this point in the history
Migrate CI from Travis to GH Actions
  • Loading branch information
kspieks committed Feb 7, 2021
2 parents f702b47 + 9b565c0 commit 0480699
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 3,659 deletions.
57 changes: 57 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
repo:
- ./*

examples:
- examples/**/*

tests:
- arc/**/*Tests.py

'Module: Conformers':
- arc/species/conformers.py

'Module: Converter':
- arc/species/converter.py

'Module: Job':
- arc/job/job.py

'Module: Local':
- arc/job/local.py

'Module: Main':
- arc/main.py

'Module: Parser':
- arc/parser.py

'Module: Plotter':
- arc/plotter.py

'Module: Processor':
- arc/processor.py

'Module: Reaction':
- arc/reaction.py

'Module: rmgdb':
- arc/rmgdb.py

'Module: Scheduler':
- arc/scheduler.py

'Module: Species':
- arc/species/species.py

'Module: SSH':
- arc/job/ssh.py

'Module: trsh':
- arc/job/trsh.py

'Module: Utils':
- arc/job/utils/**/*

'Module docs':
- arc/docs/**/*

56 changes: 56 additions & 0 deletions .github/workflows/cont_int.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: continuous integration

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up miniconda Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: arc_env
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Install dependencies
shell: bash -l {0}
run: |
export PYTHONPATH=$PYTHONPATH:$(pwd)
conda activate arc_env
cd ..
git clone https://github.com/ReactionMechanismGenerator/RMG-Py
cd RMG-Py
make
cd ..
git clone https://github.com/ReactionMechanismGenerator/RMG-database
cd ARC
conda deactivate
make gcn-cpu
cd ..
echo $(pwd)
conda list
- name: Lint with flake8
shell: bash -l {0}
run: |
conda install flake8
# stop the build if there are Python syntax errors or undefined names
python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
python -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with nosetests
shell: bash -l {0}
run: |
cd ..
cd RMG-Py
export PYTHONPATH=$PYTHONPATH:$(pwd)
cd ..
cd ARC
conda activate arc_env
make test
codecov --token=f259713a-7f1d-4e9c-b140-bb3bb371d3ef
48 changes: 48 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: github pages

on:
push:
branches:
- master
- docs

jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements.txt

- run: export PYTHONPATH=$PYTHONPATH:$(pwd); cd docs; make html

- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html/

# https://github.com/marketplace/actions/github-pages-action
16 changes: 16 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
# See: https://github.com/actions/labeler/blob/master/README.md

name: Labeler
on: [pull_request]

jobs:
label:

runs-on: ubuntu-latest

steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
78 changes: 0 additions & 78 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
################################################################################

test test-unittests:
nosetests --nocapture --nologcapture --all-modules --verbose --with-coverage --cover-inclusive --cover-package=arc --cover-erase --cover-html --cover-html-dir=testing/coverage
nosetests --nocapture --nologcapture --all-modules --verbose --with-coverage --cover-inclusive --cover-package=arc --cover-erase --cover-html --exe --cover-html-dir=testing/coverage

gcn:
bash devtools/install_gcn.sh

gcn-travis:
bash devtools/install_gcn_travis.sh
gcn-cpu:
bash devtools/install_gcn_cpu.sh

0 comments on commit 0480699

Please sign in to comment.