From 3e34a7bbeb714b000ac69f8606f3c7e4828f78a7 Mon Sep 17 00:00:00 2001 From: Congjian Wang Date: Thu, 19 Sep 2024 09:14:09 -0600 Subject: [PATCH] add github actions for testing --- .github/workflows/github-actions.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/github-actions.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000..d533f37 --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,34 @@ +name: GitHub SR2ML test +run-name: ${{ github.actor }} is testing out SR2ML +on: [push, pull_request] +jobs: + Test-SR2ML-Linux: + runs-on: [self-hosted, linux] + steps: + - run: echo " The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo " This job is now running on a ${{ runner.os }} server" + - run: echo " The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + - run: pwd + - run: cd .. && rm -Rf raven && git clone https://github.com/idaholab/raven.git + - run: python3 ../raven/scripts/install_plugins.py -s ${{ github.workspace }} + - run: WD=`(cd ../../.. && pwd)` && export RAVEN_LIBS_NAME="raven_libs_"`basename $WD` && ../raven/scripts/establish_conda_env.sh --install + - run: cd ../raven && ./build_raven + - run: ../raven/run_tests --library-report + - run: ../raven/run_tests -j4 --plugins --re=SR2ML + Test-SR2ML-Windows: + runs-on: [self-hosted, windows] + steps: + - run: echo " The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo " This job is now running on a ${{ runner.os }} server" + - run: echo " The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + - run: pwd + - run: cd ..; if (Test-Path raven) {Remove-Item -Recurse -Force raven}; git clone https://github.com/idaholab/raven.git + - run: python ../raven/scripts/install_plugins.py -s ${{ github.workspace }} + - run: $Env:RAVEN_LIBS_NAME = "raven_libraries_"+(Get-Location).Path.Split("\")[-4]; bash ../raven/scripts/establish_conda_env.sh --install --conda-defs $HOME/Miniconda3/etc/profile.d/conda.sh + - run: cd ../raven; bash ./build_raven + - run: bash ../raven/run_tests --library-report + - run: bash ../raven/run_tests -j4 --plugins --re=SR2ML