[init] #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- include/** | |
- src/** | |
workflow_dispatch: | |
jobs: | |
main: | |
name: Create branch 2D and 3D which only contains the dimension and compile each | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
dimension: [2, 3] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
repository: "NaokiHori/SimpleBubblyFlowSolver" | |
ref: "main" | |
submodules: "recursive" | |
- name: Install dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install make libopenmpi-dev libfftw3-dev | |
- name: Remove another dimension | |
run: | | |
set -x | |
set -e | |
python .github/workflows/extract_nd.py ${{ matrix.dimension }} | |
- name: Modify Makefile | |
run: | | |
set -x | |
set -e | |
sed -i "s/DNDIMS=2/DNDIMS=${{ matrix.dimension }}/g" Makefile | |
- name: Compile | |
run: | | |
make all | |
- name: Commit and push change | |
run: | | |
set -x | |
set -e | |
git switch -c ${{ matrix.dimension }}d | |
git config --local user.email "36466440+NaokiHori@users.noreply.github.com" | |
git config --local user.name "NaokiHori" | |
# add, commit, and push | |
git add Makefile | |
git add src | |
git add include | |
git commit -m "Extract ${{ matrix.dimension }}d sources" -a || true | |
git push -f origin ${{ matrix.dimension }}d | |