From 5fde3b19aae4998708167d14eaba9ef5584c8069 Mon Sep 17 00:00:00 2001 From: Alexander Dummer <62308023+alexdummer@users.noreply.github.com> Date: Fri, 3 May 2024 13:44:25 +0200 Subject: [PATCH 1/8] Create test.yml --- .github/workflows/test.yml | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..28905f4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,82 @@ +name: Run tests + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Mambaforge + uses: conda-incubator/setup-miniconda@v2 + with: + use-mamba: true + miniforge-variant: Mambaforge + miniforge-version: latest + activate-environment: anaconda-client-env + + - name: Install conda packages + shell: bash -l {0} + run: | + mamba install --file requirements.txt + + - name: Install Eigen + shell: bash -l {0} + run: | + git clone --branch 3.4.0 https://gitlab.com/libeigen/eigen.git + cd eigen + mkdir build + cd build + cmake -DBUILD_TESTING=OFF -DINCLUDE_INSTALL_DIR=$CONDA_PREFIX/include -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX .. + make install + cd ../.. + + - name: Install Autodiff + shell: bash -l {0} + run: | + git clone --branch v1.1.0 https://github.com/autodiff/autodiff.git + cd autodiff + mkdir build + cd build + cmake -DAUTODIFF_BUILD_TESTS=OFF \ + -DAUTODIFF_BUILD_PYTHON=OFF \ + -DAUTODIFF_BUILD_EXAMPLES=OFF \ + -DAUTODIFF_BUILD_DOCS=OFF \ + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ + .. + make install + cd ../.. + + - name: Install Fastor + shell: bash -l {0} + run: | + git clone https://github.com/romeric/Fastor.git + cd Fastor + cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX . + make install + cd .. + + - name: Install Marmot + shell: bash -l {0} + run: | + git clone --recurse-submodules https://github.com/MAteRialMOdelingToolbox/Marmot/ + cd Marmot + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX .. + make install + cd ../.. + + - name: Build EdelweissFE + shell: bash -l {0} + run: | + git clone https://github.com/EdelweissFE/EdelweissFE.git + pip install . + cd .. + + - name: Run tests + shell: bash -l {0} + run: | + python run_tests_edelweiss.py From 76e3c26aeac05adc171a461025350f0032d8e42b Mon Sep 17 00:00:00 2001 From: Alexander Dummer <62308023+alexdummer@users.noreply.github.com> Date: Fri, 3 May 2024 13:46:33 +0200 Subject: [PATCH 2/8] Update test.yml --- .github/workflows/test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28905f4..cfb838e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,11 +16,6 @@ jobs: miniforge-variant: Mambaforge miniforge-version: latest activate-environment: anaconda-client-env - - - name: Install conda packages - shell: bash -l {0} - run: | - mamba install --file requirements.txt - name: Install Eigen shell: bash -l {0} @@ -73,6 +68,8 @@ jobs: shell: bash -l {0} run: | git clone https://github.com/EdelweissFE/EdelweissFE.git + cd EdelweissFE + mamba install -r requirements.txt pip install . cd .. From 21f8c711596973f7c4217b4ce9ebb0a45cd7b01f Mon Sep 17 00:00:00 2001 From: Alexander Dummer <62308023+alexdummer@users.noreply.github.com> Date: Fri, 3 May 2024 14:00:01 +0200 Subject: [PATCH 3/8] Update test.yml --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cfb838e..9a45efc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,11 +69,12 @@ jobs: run: | git clone https://github.com/EdelweissFE/EdelweissFE.git cd EdelweissFE - mamba install -r requirements.txt + mamba install --file requirements.txt pip install . cd .. - name: Run tests shell: bash -l {0} run: | + python -m pip install -r requirements.txt python run_tests_edelweiss.py From 281df03ff11ceac9ea8d7f83f0e0c8dd76c1578d Mon Sep 17 00:00:00 2001 From: Alexander Dummer <62308023+alexdummer@users.noreply.github.com> Date: Fri, 3 May 2024 14:06:35 +0200 Subject: [PATCH 4/8] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a45efc..b44aef8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,4 +77,4 @@ jobs: shell: bash -l {0} run: | python -m pip install -r requirements.txt - python run_tests_edelweiss.py + python run_edelweiss_tests.py From 25a6e1e756766d220c24b3b675e276ab71f84c4d Mon Sep 17 00:00:00 2001 From: Alexander Dummer <62308023+alexdummer@users.noreply.github.com> Date: Fri, 3 May 2024 14:40:01 +0200 Subject: [PATCH 5/8] enforce integers in randint input --- buzzard/interfaces/edelweiss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buzzard/interfaces/edelweiss.py b/buzzard/interfaces/edelweiss.py index 62c192d..ec804a7 100644 --- a/buzzard/interfaces/edelweiss.py +++ b/buzzard/interfaces/edelweiss.py @@ -62,7 +62,7 @@ def getInputDictWithCurrentParameters(currParams: np.ndarray, sim: Simulation) - Input dictionary for EdelweissFE. """ - randomFileName = "_temp_" + str(rd.randint(0, 1e16)) + ".inp" + randomFileName = "_temp_" + str(rd.randint(0, int(1e16))) + ".inp" paramIDX = 0 From b9a289127ae24a9cd3948a5d8ff4392977cb9df1 Mon Sep 17 00:00:00 2001 From: Alexander Dummer <62308023+alexdummer@users.noreply.github.com> Date: Fri, 3 May 2024 14:55:48 +0200 Subject: [PATCH 6/8] Update sphinx.yml --- .github/workflows/sphinx.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 360334e..ebb66f1 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -1,12 +1,6 @@ name: Documentation -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - workflow_dispatch: - branches: [ master ] +on: [push, pull_request] jobs: build: @@ -34,7 +28,7 @@ jobs: - name: Install Eigen shell: bash -l {0} run: | - git clone https://gitlab.com/libeigen/eigen.git + git clone --branch 3.4.0 https://gitlab.com/libeigen/eigen.git cd eigen mkdir build cd build @@ -45,7 +39,7 @@ jobs: - name: Install Autodiff shell: bash -l {0} run: | - git clone https://github.com/autodiff/autodiff.git + git clone --branch v1.1.0 https://github.com/autodiff/autodiff.git cd autodiff mkdir build cd build @@ -68,7 +62,7 @@ jobs: shell: bash -l {0} run: | cd EdelweissFE - python setup.py build_ext -i + python -m pip install . cd .. - name: Building Buzzard documentation @@ -79,12 +73,6 @@ jobs: echo $EDELWEISS_PATH sphinx-build ./doc/source/ ./docs -b html - - name: Run Buzzard tests - shell: bash -l {0} - run: | - export EDELWEISS_PATH=/home/runner/work/Buzzard/Buzzard/EdelweissFE - python run_edelweiss_tests.py - - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: From 3c871ade5e9263ff7db27cf5877d5b28f217b75e Mon Sep 17 00:00:00 2001 From: Alexander Dummer <62308023+alexdummer@users.noreply.github.com> Date: Fri, 3 May 2024 14:57:52 +0200 Subject: [PATCH 7/8] Update test.yml --- .github/workflows/test.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b44aef8..0c1b264 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,8 @@ name: Run tests -on: [push, pull_request] +on: + schedule: + - cron: "0 0 * * *" jobs: build: @@ -44,15 +46,6 @@ jobs: make install cd ../.. - - name: Install Fastor - shell: bash -l {0} - run: | - git clone https://github.com/romeric/Fastor.git - cd Fastor - cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX . - make install - cd .. - - name: Install Marmot shell: bash -l {0} run: | @@ -73,7 +66,7 @@ jobs: pip install . cd .. - - name: Run tests + - name: Run Buzzard tests shell: bash -l {0} run: | python -m pip install -r requirements.txt From 109bf6f1275bda0e14cc81a5d0c3d40db04272fc Mon Sep 17 00:00:00 2001 From: Alexander Dummer <62308023+alexdummer@users.noreply.github.com> Date: Fri, 3 May 2024 15:07:53 +0200 Subject: [PATCH 8/8] Update test.yml --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c1b264..1e369ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,12 @@ name: Run tests on: schedule: - cron: "0 0 * * *" + push: + branches: + - "master" + pull_request: + branches: + - "master" jobs: build: