Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: failing workflows #350

Merged
merged 9 commits into from
Aug 16, 2023
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