Skip to content

Commit

Permalink
Merge pull request #350 from SysBioChalmers/fix/failing-workflows
Browse files Browse the repository at this point in the history
fix: failing workflows
  • Loading branch information
mihai-sysbio authored Aug 16, 2023
2 parents f6aefa6 + 30775cc commit 0f91c54
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 29 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/memote-history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
# MEMOTE wants to fetch all branches
with:
fetch-depth: 0


- name: Set up Python 3
uses: actions/setup-python@v4
with:
Expand All @@ -19,19 +21,12 @@ jobs:
- name: Install memote
run: pip install -r code/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
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ steps.setup.outputs.deployment }}
path: ${{ steps.setup.outputs.other-repo }}
ref: gh-pages
path: gh-pages-repo

# - name: Convert model
# run: |
Expand All @@ -40,21 +35,26 @@ jobs:

- name: Memote short run
run: |
git config --global user.name "memote-bot"
memote run --skip-unchanged --solver-timeout 30
memote run --ignore-git --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 }}"
git config --global user.name "memote-bot"
memote report history --filename="gh-pages-repo/history_report.html"
- name: Fetch async changes in gh-pages
run: |
cd gh-pages-repo
git pull
- name: Auto-commit results
uses: stefanzweifel/git-auto-commit-action@v4
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 }}
file_pattern: history_report.html
branch: gh-pages
repository: gh-pages-repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .github/workflows/memote-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ jobs:
with:
python-version: "3.9"

- name: Create .env
run: touch .env

- name: Install memote
run: pip install -r code/requirements/requirements.txt

- name: Memote run
run: |
memote report snapshot --solver-timeout 30 --filename="gh-pages-repo/release_report.html"
- name: Fetch async changes in gh-pages
run: |
cd gh-pages-repo
git pull
- name: Auto-commit results
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/memote-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ on: pull_request
jobs:
memote-run:
runs-on: ubuntu-latest
container:
image: ghcr.io/metabolicatlas/memote-docker:0.13
volumes:
- ${{ github.workspace }}:/project:rw
options: --user root --workdir /project

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Create .env
run: touch .env

- name: Memote on PR
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/metabolicatlas/memote-docker:0.13
options: -v ${{ github.workspace }}:/opt
shell: bash
run: |
cd /opt
pip install -r code/requirements/ci-requirements.txt
python -c 'import code.io as io; model = io.read_yeast_model(make_bigg_compliant=True); io.write_yeast_model(model)'
memote run --ignore-git --solver-timeout 30
run: |
touch .env
cd /project
pip install -r code/requirements/ci-requirements.txt
python -c 'import code.io as io; model = io.read_yeast_model(make_bigg_compliant=True); io.write_yeast_model(model)'
memote run --ignore-git --solver-timeout 30

0 comments on commit 0f91c54

Please sign in to comment.