diff --git a/.github/workflows/memote-history.yml b/.github/workflows/memote-history.yml new file mode 100644 index 00000000..0393fd38 --- /dev/null +++ b/.github/workflows/memote-history.yml @@ -0,0 +1,60 @@ +name: memote history + +on: push + +jobs: + memote-history: + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install memote + run: pip install -r requirements/ci-requirements.txt + + - name: Setup variables + id: setup + run: | + echo "::set-output name=history::history_report.html" + echo "::set-output name=deployment::$(awk -F '=' '{if (! ($0 ~ /^;/) && $0 ~ /deployment/) print $2}' memote.ini | tr -d ' ')" + echo "::set-output name=other-repo::gh-pages-repo" + + - name: Checkout repo for gh-pages branch + uses: actions/checkout@v2 + with: + repository: ${{ github.repository }} + ref: ${{ steps.setup.outputs.deployment }} + path: ${{ steps.setup.outputs.other-repo }} + + # - name: Convert model + # run: | + # touch .env + # python -c 'import code.io as io; model = io.read_yeast_model(make_bigg_compliant=True); io.write_yeast_model(model)' + + - name: Memote short run + run: | + memote run --skip-unchanged --solver-timeout 30 + + - name: Compute Memote history on push + run: | + # Generate the history report on the deployment branch + memote report history --filename="${{ steps.setup.outputs.other-repo }}/${{ steps.setup.outputs.history }}" + + - name: Auto-commit results + uses: stefanzweifel/git-auto-commit-action@v4.4.0 + with: + commit_user_name: memote-bot + commit_message: "chore: update memote history report" + file_pattern: ${{ steps.setup.outputs.history }} + branch: ${{ steps.setup.outputs.deployment }} + repository: ${{ steps.setup.outputs.other-repo }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/memote-run.yml b/.github/workflows/memote-run.yml new file mode 100644 index 00000000..2d0be14d --- /dev/null +++ b/.github/workflows/memote-run.yml @@ -0,0 +1,29 @@ +name: memote run + +on: pull_request + +jobs: + memote-run: + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install memote + run: pip install -r requirements/ci-requirements.txt + + - name: Convert model + run: | + touch .env + python -c 'import code.io as io; model = io.read_yeast_model(make_bigg_compliant=True); io.write_yeast_model(model)' + + - name: Memote on PR + run: | + # Untracked build, skip saving to gh-pages + memote run --ignore-git --solver-timeout 30 diff --git a/README.md b/README.md index 99e9089d..42fa7299 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -0,0 +1,94 @@ # yeast-GEM: The consensus genome-scale metabolic model of _Saccharomyces cerevisiae_ -[![DOI](https://zenodo.org/badge/52777598.svg)](https://zenodo.org/badge/latestdoi/52777598) [![GitHub version](https://badge.fury.io/gh/sysbiochalmers%2Fyeast-gem.svg)](https://badge.fury.io/gh/sysbiochalmers%2Fyeast-gem) [![Join the chat at https://gitter.im/SysBioChalmers/yeast-GEM](https://badges.gitter.im/SysBioChalmers/yeast-GEM.svg)](https://gitter.im/SysBioChalmers/yeast-GEM?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![DOI](https://zenodo.org/badge/52777598.svg)](https://zenodo.org/badge/latestdoi/52777598) [![GitHub version](https://badge.fury.io/gh/sysbiochalmers%2Fyeast-gem.svg)](https://badge.fury.io/gh/sysbiochalmers%2Fyeast-gem) [![Join the chat at https://gitter.im/SysBioChalmers/yeast-GEM](https://badges.gitter.im/SysBioChalmers/yeast-GEM.svg)](https://gitter.im/SysBioChalmers/yeast-GEM?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Memote history](https://github.com/SysBioChalmers/yeast-GEM/workflows/Memote%20history/badge.svg)](https://sysbiochalmers.github.io/yeast-GEM/history_report.html) ## Description @@ -53,7 +53,14 @@ This repository contains the current consensus genome-scale metabolic model of _ * The [RAVEN toolbox for MATLAB](https://github.com/SysBioChalmers/RAVEN). * A [git wrapper](https://github.com/manur/MATLAB-git) added to the search path. -### Dependencies - Recommended software: +**NOTE:** You also require [git lfs](https://git-lfs.github.com/) if you wish to run locally any of the following two [memote](https://github.com/opencobra/memote) commands: +* `memote run` +* `memote report history` + +This is because `results.db` (the database that stores all memote results) is tracked with git lfs. + +### Dependencies - Recommended Software: + * For Matlab, the [libSBML MATLAB API](https://sourceforge.net/projects/sbml/files/libsbml/MATLAB%20Interface/) (version 5.17.0 is recommended). * [Gurobi Optimizer](http://www.gurobi.com/registration/download-reg) for any simulations. diff --git a/memote.ini b/memote.ini new file mode 100644 index 00000000..5760e21a --- /dev/null +++ b/memote.ini @@ -0,0 +1,6 @@ +[memote] +model = model/yeast-GEM.xml +location = sqlite:///results.db +github_username = SysBioChalmers +github_repository = yeast-GEM +deployment = gh-pages diff --git a/requirements/ci-requirements.in b/requirements/ci-requirements.in index 36039b70..16b945b0 100644 --- a/requirements/ci-requirements.in +++ b/requirements/ci-requirements.in @@ -1,3 +1,5 @@ # Requirements for GitHub Actions: cobra -memote \ No newline at end of file +memote +python-dotenv +symengine \ No newline at end of file