Skip to content

Commit 80847f4

Browse files
committed
Merge branch 'it_04_07_2024' of github.com:ithiele/cobratoolbox into it_04_07_2024
2 parents 0227831 + e7abf4b commit 80847f4

File tree

3,326 files changed

+4045229
-6328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,326 files changed

+4045229
-6328
lines changed
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update Contributors list
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies
21+
working-directory: ./documentation/source/Contributions
22+
run: |
23+
pip install -r requirements.txt
24+
25+
- name: Update contributors
26+
working-directory: ./documentation/source/Contributions
27+
run: |
28+
python UpdateContributorsList.py
29+
30+
- name: Generate HTML file
31+
working-directory: ./documentation/source/Contributions
32+
run: |
33+
python GenerateContributorsHTML.py
34+
35+
- name: Deploy to docs
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./documentation/source/Contributions/contributors
40+
publish_branch: develop
41+
keep_files: true
42+
destination_dir: docs
43+
commit_message: "Update Contributors (Automatic Workflow)"
+67-25
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,75 @@
11
name: Update function docs
22

33
on:
4-
pull_request_target:
5-
types:
6-
- closed
7-
branches: [ master ]
4+
push:
5+
branches:
6+
- develop
7+
88
jobs:
99
build:
10-
if: github.event.pull_request.merged == true
1110
runs-on: ubuntu-latest
1211

1312
steps:
14-
- uses: actions/checkout@v3
15-
- name: Set up Python 3.10
16-
uses: actions/setup-python@v3
17-
with:
18-
python-version: '3.10'
19-
- name: Install dependencies
20-
working-directory: ./docs
21-
run: |
22-
pip install -r requirements.txt
23-
- name: generate documentation
24-
working-directory: ./docs
25-
run: |
26-
make html
27-
- name: Deploy
28-
uses: JamesIves/github-pages-deploy-action@v4
29-
with:
30-
folder: ./docs/build/html/modules
31-
branch: gh-pages
32-
target-folder: latest/modules
33-
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies
21+
working-directory: ./documentation
22+
run: |
23+
pip install -r requirements.txt
24+
25+
- name: Generate publications rst file
26+
working-directory: ./documentation/source/sphinxext
27+
run: |
28+
python GenerateCitationsRST.py
29+
30+
- name: Update packages
31+
working-directory: ./documentation/source
32+
run: |
33+
python ./sphinxext/copy_files.py
34+
35+
- name: Generate functions rst files
36+
working-directory: ./documentation/source/modules
37+
run: |
38+
python ./GetRSTfiles.py
39+
40+
- name: Generate documentation
41+
working-directory: ./documentation
42+
run: |
43+
make html
44+
45+
- name: Copy the citations html page
46+
run: |
47+
cp ./documentation/build/html/citations.html ./documentation/source/Citations/citations.html
48+
49+
- name: Deploy the function modules
50+
uses: JamesIves/github-pages-deploy-action@v4
51+
with:
52+
folder: ./documentation/build/html/modules
53+
branch: develop
54+
target-folder: docs/modules
55+
commit-message: "update Function Docs (Automatic Workflow)"
56+
57+
- name: Deploy the citations page
58+
uses: peaceiris/actions-gh-pages@v3
59+
with:
60+
github_token: ${{ secrets.GITHUB_TOKEN }}
61+
publish_dir: ./documentation/source/Citations
62+
publish_branch: develop
63+
keep_files: true
64+
destination_dir: docs
65+
commit_message: "update Function Docs (Automatic Workflow)"
66+
67+
- name: Deploy the citations static page
68+
uses: peaceiris/actions-gh-pages@v3
69+
with:
70+
github_token: ${{ secrets.GITHUB_TOKEN }}
71+
publish_dir: ./documentation/build/html/_static
72+
publish_branch: develop
73+
keep_files: true
74+
destination_dir: docs/_static
75+
commit_message: "update Function Docs (Automatic Workflow)"
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Extract HTML Info
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
paths:
7+
- '**.html'
8+
9+
jobs:
10+
extract-info:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v2
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
fetch-depth: 0
18+
19+
- name: Check Commit Message
20+
id: check_msg
21+
run: |
22+
commit_msg=$(git log --format=%B -n 1)
23+
if [[ "$commit_msg" == "Sync files from source repo" ]]; then
24+
echo "run_job=true" >> $GITHUB_OUTPUT
25+
else
26+
echo "run_job=false" >> $GITHUB_OUTPUT
27+
fi
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v2
31+
if: steps.check_msg.outputs.run_job == 'true'
32+
with:
33+
python-version: '3.x'
34+
35+
- name: Install Dependencies
36+
if: steps.check_msg.outputs.run_job == 'true'
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install beautifulsoup4
40+
41+
- name: Get Changed HTML Files and update the index.html file of tutorial
42+
id: getfile
43+
if: steps.check_msg.outputs.run_job == 'true'
44+
run: |
45+
changed_files=$(git diff --name-only HEAD~1 HEAD | grep '\.html' | tr '\n' ' ')
46+
for file in $changed_files; do
47+
echo "Processing: $file"
48+
python ./docs/extract_info.py $file
49+
done
50+
51+
- name: Commit and Push New File
52+
if: steps.check_msg.outputs.run_job == 'true'
53+
run: |
54+
git config user.name "github-actions[bot]"
55+
git config user.email "github-actions[bot]@users.noreply.github.com"
56+
git add .
57+
git commit -m "Update Tutorial (Automatic Workflow)" || echo "No changes to commit"
58+
git push origin master

.github/workflows/main.yml

-23
This file was deleted.

.github/workflows/testAllCI_step1.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: cobratoolboxCI (merge, test, and upload)
2+
on:
3+
pull_request:
4+
branches:
5+
- develop
6+
- master
7+
types: [opened, synchronize, reopened]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: self-hosted
16+
steps:
17+
- name: Check out merged PR code
18+
uses: actions/checkout@v4
19+
20+
- name: Run MATLAB Tests
21+
run: |
22+
matlab -batch "run('initCobraToolbox.m'); run('test/testAll.m');"
23+
24+
- name: Convert JUnit to CTRF
25+
run: |
26+
npx junit-to-ctrf ./testReport.junit.xml -o ./ctrf/ctrf-report.json
27+
28+
- name: Upload CTRF Artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: testReport
32+
path: ./ctrf/ctrf-report.json
33+
34+
- name: Save PR Number
35+
run: echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
36+
37+
- name: Upload PR Number as Artifact
38+
run: echo $PR_NUMBER > pr_number.txt
39+
shell: bash
40+
41+
- name: Upload PR Number Artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: pr_number
45+
path: pr_number.txt

.github/workflows/testAllCI_step2.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: testReport (Comment on PR)
2+
3+
on:
4+
workflow_run:
5+
workflows: ['cobratoolboxCI (merge, test, and upload)']
6+
types: [completed]
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
publish-report:
14+
runs-on: ubuntu-latest
15+
if: github.event.workflow_run.conclusion == 'success'
16+
steps:
17+
18+
- name: Download CTRF Artifact
19+
uses: dawidd6/action-download-artifact@v8
20+
with:
21+
name: testReport
22+
run_id: ${{ github.event.workflow_run.id }}
23+
path: artifacts
24+
25+
- name: Download PR Number Artifact
26+
uses: dawidd6/action-download-artifact@v8
27+
with:
28+
name: pr_number
29+
run_id: ${{ github.event.workflow_run.id }}
30+
path: pr_number
31+
32+
- name: Read PR Number
33+
id: read_pr_number
34+
run: |
35+
PR_NUMBER=$(cat pr_number/pr_number.txt)
36+
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
37+
38+
- name: Publish Test Report
39+
uses: ctrf-io/[email protected]
40+
with:
41+
report-path: 'artifacts/ctrf-report.json'
42+
community-report: true
43+
community-report-name: 'cobra-report'
44+
issue: ${{ env.PR_NUMBER }}
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)