diff --git a/.dockerignore b/.dockerignore index 396922b2..c8086a91 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,7 +5,6 @@ # ignore build folders bin build -sconsbuild # ignore test files *.json diff --git a/.gitattributes b/.gitattributes index ba301b9f..30c8078b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.ipynb linguist-detectable=false *.ref filter=lfs diff=lfs merge=lfs -text +* text=auto diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8143b4a8..610ae4c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,38 +1,47 @@ -# This is a basic workflow to help you get started with Actions +name: Build and Test on Ubuntu -name: CI - -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the "master" branch push: branches: - "master" - - "actions" + - "dev-ci" pull_request: branches: [ "master" ] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + + build-native: + runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - # Runs a single command using the runners shell - name: Forefirebuild run: sudo sh ./install-forefire.sh - name: Check version run: ./bin/forefire -v - - name: Test - run: sh ./test-forefire.sh \ No newline at end of file + # - name: Test + # run: cd tests && bash run.bash + + + docker: + runs-on: ubuntu-latest + needs: build-native + steps: + - uses: actions/checkout@v3 + + - name: Build Docker Image + run: docker build -t forefire:latest . + + - name: Test Docker Image + run: | + # Run the container and check the version output + docker run --rm forefire:latest forefire -v + + # - name: Run test inside Docker container + # run: docker run --rm forefire:latest sh ./test-forefire.sh \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..71b1f49d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:22.04 + +# install requirements first to cache it +RUN apt-get update + +RUN apt install build-essential -y + +RUN apt install libnetcdf-c++4-dev -y + +RUN apt install cmake -y + +# copy files inside docker +WORKDIR /forefire + +COPY . . + +# install forefire +RUN sh cmake-build.sh + +# add executable to PATH +RUN cp /forefire/bin/forefire /bin diff --git a/README.md b/README.md index 7761d21f..d73e7d04 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ForeFire -![logo](./doc/images/forefire.jpg) +![logo](./docs/images/forefire.jpg) _Refer to the [Wiki](https://github.com/forefireAPI/firefront/wiki) for a more detailed guide on using ForeFire._ @@ -8,7 +8,7 @@ ForeFire is an [open-source code for wildland fire spread models](https://www.re Access the [demo simulator here](http://forefire.univ-corse.fr/sim/dev/). -![demo](./doc/images/sim-forefire.jpg) +![demo](./docs/images/sim-forefire.jpg) It has been designed and runs on Unix systems. Three modules can be built with the source code. @@ -75,7 +75,7 @@ export PATH="/mnt/c/gitrepos/forefire/bin:$PATH" ### 2.2 Scons and Other build systems -More information on other build systems are available [here](./doc/buildSystems/readme.MD) +More information on other build systems are available [here](./docs/buildSystems/readme.MD) ## 3. Running an example