Skip to content

Commit afdf6e9

Browse files
committed
moved auto-gen GH action job into separate workflow
1 parent a361b0e commit afdf6e9

File tree

2 files changed

+143
-116
lines changed

2 files changed

+143
-116
lines changed

.github/workflows/auto-gen.yaml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
# For deployment, it will be necessary to create a PyPI API token and store it as a secret
5+
# https://docs.github.com/en/actions/reference/encrypted-secrets
6+
7+
name: CI/CD
8+
9+
10+
on:
11+
workflow_dispatch: # Trigger this workflow manually or via a repository dispatch event
12+
repository_dispatch:
13+
types: [auto-gen]
14+
15+
16+
env:
17+
MRTRIX_HOME: /opt/mrtrix3
18+
MRTRIX_INSTALL: /opt/mrtrix3/install
19+
MRTRIX_VERSION: 3.1.0
20+
SUBPKG_NAME: v3_1
21+
22+
jobs:
23+
24+
generate:
25+
26+
runs-on: ubuntu-latest
27+
28+
env:
29+
CFLAGS: -Werror
30+
QT_SELECT: qt6
31+
SCCACHE_GHA_ENABLED: "true"
32+
SCCACHE_CACHE_SIZE: "2G"
33+
34+
steps:
35+
- uses: actions/checkout@v3
36+
with:
37+
submodules: true
38+
- name: Set Git User
39+
# checkout@v2 adds a header that makes branch protection report errors
40+
# because the Github action bot is not a collaborator on the repo
41+
run: |
42+
git config --global user.email "[email protected]"
43+
git config --global user.name "Dummy User"
44+
- name: Unset header
45+
# checkout@v2 adds a header that makes branch protection report errors
46+
# because the Github action bot is not a collaborator on the repo
47+
run: git config --local --unset http.https://github.com/.extraheader
48+
- name: Fetch tags
49+
run: git fetch --prune --unshallow
50+
- name: Create auto-gen tag
51+
run: git tag -a old-auto-gen -m "Old point of auto-generation"
52+
- name: Checkout auto-gen branch
53+
run: git checkout auto-gen
54+
- name: install dependencies
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install clang qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build
58+
- name: Run sccache-cache
59+
uses: mozilla-actions/[email protected]
60+
- name: Get CMake
61+
uses: lukka/get-cmake@latest
62+
with:
63+
cmakeVersion: '3.16.3'
64+
- name: Print CMake version
65+
run: cmake --version
66+
- name: Clone latest MRtrix and switch to latest tag
67+
run: |
68+
mkdir $MRTRIX_HOME
69+
sudo chown -R $USER $MRTRIX_HOME
70+
git clone https://github.com/tclose/mrtrix3.git $MRTRIX_HOME/src
71+
cd $MRTRIX_HOME/src
72+
git checkout print-pydra-dev
73+
git tag -a $MRTRIX_VERSION -m"Tag used to create a pydra-task-mrtrix3 release"
74+
git describe --abbrev=0
75+
# echo "MRTRIX_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
76+
# git checkout $MRTRIX_VERSION
77+
- name: configure
78+
run: |
79+
cd $MRTRIX_HOME/src
80+
cmake \
81+
-B build \
82+
-G Ninja \
83+
-D CMAKE_BUILD_TYPE=Release \
84+
-D MRTRIX_BUILD_TESTS=ON \
85+
-D MRTRIX_STL_DEBUGGING=ON \
86+
-D MRTRIX_WARNINGS_AS_ERRORS=ON \
87+
-D CMAKE_C_COMPILER=clang \
88+
-D CMAKE_CXX_COMPILER=clang++ \
89+
-D CMAKE_INSTALL_PREFIX=$MRTRIX_INSTALL
90+
- name: Build Mrtrix
91+
run: |
92+
cd $MRTRIX_HOME/src
93+
cmake --build build
94+
- name: Install Mrtrix
95+
run: |
96+
cd $MRTRIX_HOME/src
97+
cmake --install build
98+
- name: Set PATH Variable
99+
run: echo "PATH=$PATH:$MRTRIX_INSTALL/bin" >> $GITHUB_ENV
100+
- name: Set LD_LIBRARY_PATH Variable
101+
run: echo "LD_LIBRARY_PATH=$MRTRIX_INSTALL/lib" >> $GITHUB_ENV
102+
- name: Change back to the root directory
103+
run: cd ..
104+
- name: Set up Python
105+
uses: actions/setup-python@v5
106+
- name: Install Python build dependencies
107+
run: |
108+
python -m pip install --upgrade pip
109+
- name: Install pydra-auto-gen requirements
110+
run: >
111+
pip install
112+
-e related-packages/fileformats
113+
-e related-packages/fileformats-extras
114+
-e .[dev,test]
115+
- name: Install development Pydra
116+
run: pip install --no-deps git+https://github.com/nipype/pydra.git@develop
117+
- name: Generate task specifications
118+
run: >
119+
./generate.py
120+
$MRTRIX_INSTALL/bin
121+
$(pwd)
122+
$MRTRIX_VERSION
123+
--raise-errors
124+
--latest
125+
- name: Commit changes to auto-gen branch
126+
run: |
127+
git add .
128+
git commit -m "Refresh of auto-generated task specifications"
129+
git push
130+
- name: Rebase main on auto-gen
131+
run: |
132+
git checkout main
133+
git checkout -b main-rebase
134+
git rebase old-auto-gen --onto auto-gen
135+
- name: Create pull request
136+
uses: peter-evans/create-pull-request@v4
137+
with:
138+
branch: main-rebase
139+
title: 'Rebase main on auto-gen'
140+
body: 'This PR rebases the main branch on the auto-gen branch to include the latest Nipype to Pydra conversions.'
141+
base: main
142+
commit-message: 'Rebase main on auto-gen'
143+
labels: auto-gen

.github/workflows/ci-cd.yml renamed to .github/workflows/ci-cd.yaml

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -25,123 +25,7 @@ env:
2525

2626
jobs:
2727

28-
generate:
29-
30-
runs-on: ubuntu-latest
31-
32-
env:
33-
CFLAGS: -Werror
34-
QT_SELECT: qt6
35-
SCCACHE_GHA_ENABLED: "true"
36-
SCCACHE_CACHE_SIZE: "2G"
37-
38-
steps:
39-
- uses: actions/checkout@v2
40-
with:
41-
submodules: true
42-
- name: Set Git User
43-
# checkout@v2 adds a header that makes branch protection report errors
44-
# because the Github action bot is not a collaborator on the repo
45-
run: |
46-
git config --global user.email "[email protected]"
47-
git config --global user.name "Dummy User"
48-
- name: Unset header
49-
# checkout@v2 adds a header that makes branch protection report errors
50-
# because the Github action bot is not a collaborator on the repo
51-
run: git config --local --unset http.https://github.com/.extraheader
52-
- name: Fetch tags
53-
run: git fetch --prune --unshallow
54-
- name: install dependencies
55-
run: |
56-
sudo apt-get update
57-
sudo apt-get install clang qt6-base-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev ninja-build
58-
- name: Run sccache-cache
59-
uses: mozilla-actions/[email protected]
60-
- name: Get CMake
61-
uses: lukka/get-cmake@latest
62-
with:
63-
cmakeVersion: '3.16.3'
64-
- name: Print CMake version
65-
run: cmake --version
66-
- name: Clone latest MRtrix and switch to latest tag
67-
run: |
68-
mkdir $MRTRIX_HOME
69-
sudo chown -R $USER $MRTRIX_HOME
70-
git clone https://github.com/tclose/mrtrix3.git $MRTRIX_HOME/src
71-
cd $MRTRIX_HOME/src
72-
git checkout pydra-usage-new-syntax
73-
git tag -a $MRTRIX_VERSION -m"Tag used to create a pydra-mrtrix3 release"
74-
git describe --abbrev=0
75-
# echo "MRTRIX_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
76-
# git checkout $MRTRIX_VERSION
77-
- name: configure
78-
run: |
79-
cd $MRTRIX_HOME/src
80-
cmake \
81-
-B build \
82-
-G Ninja \
83-
-D CMAKE_BUILD_TYPE=Release \
84-
-D MRTRIX_BUILD_TESTS=ON \
85-
-D MRTRIX_STL_DEBUGGING=ON \
86-
-D MRTRIX_WARNINGS_AS_ERRORS=ON \
87-
-D CMAKE_C_COMPILER=clang \
88-
-D CMAKE_CXX_COMPILER=clang++ \
89-
-D CMAKE_INSTALL_PREFIX=$MRTRIX_INSTALL
90-
- name: Build Mrtrix
91-
run: |
92-
cd $MRTRIX_HOME/src
93-
cmake --build build
94-
- name: Install Mrtrix
95-
run: |
96-
cd $MRTRIX_HOME/src
97-
cmake --install build
98-
- name: Set PATH Variable
99-
run: echo "PATH=$PATH:$MRTRIX_INSTALL/bin" >> $GITHUB_ENV
100-
- name: Set LD_LIBRARY_PATH Variable
101-
run: echo "LD_LIBRARY_PATH=$MRTRIX_INSTALL/lib" >> $GITHUB_ENV
102-
- name: Change back to the root directory
103-
run: cd ..
104-
- name: Set up Python
105-
uses: actions/setup-python@v2
106-
- name: Install Python build dependencies
107-
run: |
108-
python -m pip install --upgrade pip
109-
- name: Install pydra-auto-gen requirements
110-
run: >
111-
pip install
112-
-e related-packages/fileformats
113-
-e related-packages/fileformats-extras
114-
-e .[dev,test]
115-
- name: Install development Pydra
116-
run: pip install --no-deps git+https://github.com/nipype/pydra.git@develop
117-
- name: Generate task specifications
118-
run: >
119-
./generate.py
120-
$MRTRIX_INSTALL/bin
121-
$(pwd)
122-
$MRTRIX_VERSION
123-
--raise-errors
124-
--latest
125-
- name: Upload MRtrix3 install
126-
uses: actions/upload-artifact@v4
127-
with:
128-
name: MRtrix3
129-
path: ${{ env.MRTRIX_INSTALL}}
130-
- name: Upload auto-gen pydra
131-
uses: actions/upload-artifact@v4
132-
with:
133-
name: AutoGen
134-
path: pydra/tasks/mrtrix3/${{ env.SUBPKG_NAME }}
135-
- name: Write version file
136-
run: echo $MRTRIX_VERSION > mrtrix3_version.txt
137-
- name: Upload version file
138-
uses: actions/upload-artifact@v4
139-
with:
140-
name: VersionFile
141-
path: mrtrix3_version.txt
142-
14328
test:
144-
needs: [generate]
14529
runs-on: ubuntu-latest
14630
strategy:
14731
matrix:

0 commit comments

Comments
 (0)