diff --git a/.github/workflows/ci-test-jobs.yml b/.github/workflows/ci-test-jobs.yml deleted file mode 100644 index b35792cf..00000000 --- a/.github/workflows/ci-test-jobs.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Test workflow - -on: - workflow_call: - inputs: - VAR_1: - required: true - type: string - VAR_2: - required: true - type: string - -jobs: - job-1: - name: Some job no. 1 - env: - VAR_1: ${{ inputs.VAR_1 }} - runs-on: ubuntu-latest - steps: - - name: "First step: show variable" - run: echo $VAR_1 - - job-2: - name: Some job no. 2 - env: - VAR_2: ${{ inputs.VAR_2 }} - runs-on: ubuntu-latest - steps: - - name: "First step: show variable" - run: echo $VAR_2 - diff --git a/.github/workflows/ci-test-run.yml b/.github/workflows/ci-test-run.yml deleted file mode 100644 index fbf712d0..00000000 --- a/.github/workflows/ci-test-run.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Workflow de test - -on: push - -jobs: - jobi: - name: Run the jobs - uses: ./.github/workflows/ci-test-jobs.yml - with: - VAR_1: Hello - VAR_2: Goodbye - - joba: - name: Run the jobs - uses: ./.github/workflows/ci-test-jobs.yml - with: - VAR_1: "Hello flop" - VAR_2: "Goodbye flip" diff --git a/.github/workflows/idefix-ci-cuda.yml b/.github/workflows/idefix-ci-cuda.yml new file mode 100644 index 00000000..b230d5b3 --- /dev/null +++ b/.github/workflows/idefix-ci-cuda.yml @@ -0,0 +1,18 @@ +name: Idefix CIs CUDA +on: + workflow_dispatch: + push: + branches: + - master + - v2.0 + - marc-test-ci + pull_request: + paths-ignore: + - '.github/ISSUE_TEMPLATE/*' + +jobs: + jobs: + name: CUDA Jobs + uses: ./.github/workflows/idefix-ci-jobs.yml + with: + TESTME_OPTIONS: -cuda -Werror diff --git a/.github/workflows/idefix-ci-jobs.yml b/.github/workflows/idefix-ci-jobs.yml new file mode 100644 index 00000000..fa98e148 --- /dev/null +++ b/.github/workflows/idefix-ci-jobs.yml @@ -0,0 +1,291 @@ +on: + workflow_call: + inputs: + TESTME_OPTIONS: + required: true + type: string + +concurrency: + # auto-cancel any concurrent job *in the same context* + # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency + # see https://docs.github.com/en/actions/learn-github-actions/contexts#github-context + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + TESTME_OPTIONS: ${{ inputs.TESTME_OPTIONS }} + PYTHONPATH: ${{ github.workspace }} + IDEFIX_DIR: ${{ github.workspace }} + +jobs: + Linter: + # Don't do this in forks + if: ${{ github.repository == 'idefix-code/idefix' || github.repository == 'glesur/idefix' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.0 + - uses: pre-commit-ci/lite-action@v1.0.0 + if: always() + + ShocksHydro: + needs: Linter + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Sod test + run: | + cd $IDEFIX_DIR/test/HD/sod + ./testme.py -all $TESTME_OPTIONS + - name: Isothermal Sod test + run: | + cd $IDEFIX_DIR/test/HD/sod-iso + ./testme.py -all $TESTME_OPTIONS + - name: Mach reflection test + run: | + cd $IDEFIX_DIR/test/HD//MachReflection + ./testme.py -all $TESTME_OPTIONS + + ParabolicHydro: + needs: Linter + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Viscous flow past cylinder + run: | + cd $IDEFIX_DIR/test/HD/ViscousFlowPastCylinder + ./testme.py -all $TESTME_OPTIONS + - name: Viscous disk + run: | + cd $IDEFIX_DIR/test/HD/ViscousDisk + ./testme.py -all $TESTME_OPTIONS + - name: Thermal diffusion + run: | + cd $IDEFIX_DIR/test/HD/thermalDiffusion + ./testme.py -all $TESTME_OPTIONS + + ShocksMHD: + needs: Linter + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: MHD Sod test + run: | + cd $IDEFIX_DIR/test/MHD/sod + ./testme.py -all $TESTME_OPTIONS + - name: MHD Isothermal Sod test + run: | + cd $IDEFIX_DIR/test/MHD/sod-iso + ./testme.py -all $TESTME_OPTIONS + - name: Orszag Tang + run: | + cd $IDEFIX_DIR/test/MHD/OrszagTang + ./testme.py -all $TESTME_OPTIONS + - name: Orszag Tang 3D+restart tests + run: | + cd $IDEFIX_DIR/test/MHD/OrszagTang3D + ./testme.py -all $TESTME_OPTIONS + + + ParabolicMHD: + needs: Linter + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Ambipolar C Shock + run: | + cd $IDEFIX_DIR/test/MHD/AmbipolarCshock + ./testme.py -all $TESTME_OPTIONS + - name: Ambipolar C Shock 3D + run: | + cd $IDEFIX_DIR/test/MHD/AmbipolarCshock3D + ./testme.py -all $TESTME_OPTIONS + - name: Resistive Alfvén wave + run: | + cd $IDEFIX_DIR/test/MHD/ResistiveAlfvenWave + ./testme.py -all $TESTME_OPTIONS + - name: Grid coarsening diffusion + run: | + cd $IDEFIX_DIR/test/MHD/Coarsening + ./testme.py -all $TESTME_OPTIONS + - name: Hall whistler waves + run: | + cd $IDEFIX_DIR/test/MHD/HallWhistler + ./testme.py -all $TESTME_OPTIONS + + Fargo: + needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Fargo + planet + run: | + cd $IDEFIX_DIR/test/HD/FargoPlanet + ./testme.py -all $TESTME_OPTIONS + - name: Fargo MHD spherical + run: | + cd $IDEFIX_DIR/test/MHD/FargoMHDSpherical + ./testme.py -all $TESTME_OPTIONS + + ShearingBox: + needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Hydro shearing box + run: | + cd $IDEFIX_DIR/test/HD/ShearingBox + ./testme.py -all $TESTME_OPTIONS + - name: MHD shearing box + run: | + cd $IDEFIX_DIR/test/MHD/ShearingBox + ./testme.py -all $TESTME_OPTIONS + + SelfGravity: + needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Jeans Instability + run: | + cd $IDEFIX_DIR/test/SelfGravity/JeansInstability + ./testme.py -all $TESTME_OPTIONS + - name: Random sphere spherical + run: | + cd $IDEFIX_DIR/test/SelfGravity/RandomSphere + ./testme.py -all $TESTME_OPTIONS + - name: Random sphere cartesian + run: | + cd $IDEFIX_DIR/test/SelfGravity/RandomSphereCartesian + ./testme.py -all $TESTME_OPTIONS + - name: Uniform spherical collapse + run: | + cd $IDEFIX_DIR/test/SelfGravity/UniformCollapse + ./testme.py -all $TESTME_OPTIONS + - name: Dusty spherical collapse + run: | + cd $IDEFIX_DIR/test/SelfGravity/DustyCollapse + ./testme.py -all $TESTME_OPTIONS + + Planet: + needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: 3 body + run: | + cd $IDEFIX_DIR/test/Planet/Planet3Body + ./testme.py -all $TESTME_OPTIONS + - name: migration + run: | + cd $IDEFIX_DIR/test/Planet/PlanetMigration2D + ./testme.py -all $TESTME_OPTIONS + - name: planet-planet + run: | + cd $IDEFIX_DIR/test/Planet/PlanetPlanetRK42D + ./testme.py -all $TESTME_OPTIONS + - name: spiral wake + run: | + cd $IDEFIX_DIR/test/Planet/PlanetSpiral2D + ./testme.py -all $TESTME_OPTIONS + - name: torques + run: | + cd $IDEFIX_DIR/test/Planet/PlanetTorque3D + ./testme.py -all $TESTME_OPTIONS + - name: RK5 + run: | + cd $IDEFIX_DIR/test/Planet/PlanetsIsActiveRK52D + ./testme.py -all $TESTME_OPTIONS + + Dust: + needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Energy conservation + run: | + cd $IDEFIX_DIR/test/Dust/DustEnergy + ./testme.py -all $TESTME_OPTIONS + - name: Dusty wave + run: | + cd $IDEFIX_DIR/test/Dust/DustyWave + ./testme.py -all $TESTME_OPTIONS + + Braginskii: + needs: [Linter, ShocksHydro, ParabolicHydro, ShocksMHD, ParabolicMHD] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: MTI + run: | + cd $IDEFIX_DIR/test/MHD/MTI + ./testme.py -all $TESTME_OPTIONS + - name: Spherical anisotropic diffusion + run: | + cd $IDEFIX_DIR/test/MHD/sphBragTDiffusion + ./testme.py -all $TESTME_OPTIONS + - name: Spherical anisotropic viscosity + run: | + cd $IDEFIX_DIR/test/MHD/sphBragViscosity + ./testme.py -all $TESTME_OPTIONS + + Examples: + needs: [Fargo, Dust, Planet, ShearingBox, SelfGravity] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Run examples test + run: cd test && ./checks_examples.sh $TEST_OPTIONS + + Utils: + needs: [Fargo, Dust, Planet, ShearingBox, SelfGravity] + runs-on: self-hosted + steps: + - name: Check out repo + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Lookup table + run: | + cd $IDEFIX_DIR/test/utils/lookupTable + ./testme.py -all $TESTME_OPTIONS + - name: Dump Image + run: | + cd $IDEFIX_DIR/test/utils/dumpImage + ./testme.py -all $TESTME_OPTIONS