forked from mdolab/dafoam
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 1.39 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: tests
on: [push, pull_request]
env:
REPO_NAME: 'dafoam'
DOCKER_WORKING_DIR: '/home/dafoamuser/dafoam/$REPO_NAME'
DOCKER_MOUNT_DIR: '/home/dafoamuser/mount/$REPO_NAME'
DOCKER_TAG: 'latest'
DOCKER_ENV_FILE: '/home/dafoamuser/dafoam/loadDAFoam.sh'
DOCKER_OF_ADF_BASHRC: '/home/dafoamuser/dafoam/OpenFOAM/OpenFOAM-v1812-ADF/etc/bashrc'
DOCKER_OF_ADR_BASHRC: '/home/dafoamuser/dafoam/OpenFOAM/OpenFOAM-v1812-ADR/etc/bashrc'
jobs:
reg_tests:
runs-on: ubuntu-20.04
name: Tests
strategy:
fail-fast: false
matrix:
testConfig: [incompressible]
include:
- testConfig: incompressible
args: 'incompressible'
steps:
- uses: actions/checkout@v3
- name: Create the docker container and run the tests
run: |
docker pull dafoam/opt-packages:${{env.DOCKER_TAG}}
docker run -i -d -u dafoamuser --name regtest -v $GITHUB_WORKSPACE:${{env.DOCKER_MOUNT_DIR}} dafoam/opt-packages:${{env.DOCKER_TAG}} /bin/bash
docker exec -i regtest /bin/bash -c "rm -rf ${{env.DOCKER_WORKING_DIR}} && cp -r ${{env.DOCKER_MOUNT_DIR}} ${{env.DOCKER_WORKING_DIR}}"
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake"
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}}/tests && python runUnitTests_DAOption.py"