-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from allanleal/ci-as-github-actions
Add GitHub Actions to build and test ThermoFun (Linux/macOS/Windows)
- Loading branch information
Showing
4 changed files
with
235 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: linux | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
|
||
schedule: | ||
- cron: "0 5 * * 1" # runs at 05:00 UTC on Mondays | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.config }} build on ${{ matrix.os }} (Python ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
max-parallel: 4 | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
python-version: [3.9] | ||
config: ["Release"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Timestamp # Idea from https://tinyurl.com/47wz7vpv | ||
id: timestamp | ||
shell: cmake -P {0} | ||
run: | | ||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) | ||
message("::set-output name=now::${current_date}") | ||
- name: Configuring Cache | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
/home/runner/.cache | ||
/home/runner/conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-${{ matrix.config }}-${{ runner.python-version }}-${{ github.ref }}-ccache-${ { steps.timestamp.outputs.now } } | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.config }}-${{ runner.python-version }}-${{ github.ref }}-ccache- | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge | ||
channel-priority: true | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set true for caching of miniconda packages to work properly! | ||
|
||
- name: Configuring Conda Environment | ||
shell: bash -l {0} | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
run: | | ||
conda config --set always_yes yes --set changeps1 no | ||
conda config --add channels conda-forge | ||
conda install conda-devenv=2 | ||
conda devenv | ||
- name: Building, Testing & Installing ThermoFun | ||
shell: bash -l {0} | ||
run: | | ||
source activate thermofun | ||
ccache -s | ||
ccache -z | ||
mkdir .build && cd .build | ||
cmake -GNinja .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} | ||
ninja | ||
ninja install | ||
python -c "import thermofun" | ||
ccache -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: osx | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
|
||
schedule: | ||
- cron: "0 5 * * 1" # runs at 05:00 UTC on Mondays | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.config }} build on ${{ matrix.os }} (Python ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
max-parallel: 4 | ||
matrix: | ||
os: ["macos-latest"] | ||
python-version: [3.9] | ||
config: ["Release"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Timestamp # Idea from https://tinyurl.com/47wz7vpv | ||
id: timestamp | ||
shell: cmake -P {0} | ||
run: | | ||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) | ||
message("::set-output name=now::${current_date}") | ||
- name: Configuring Cache | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
/Users/runner/Library/Caches/ccache | ||
/Users/runner/conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-${{ matrix.config }}-${{ runner.python-version }}-${{ github.ref }}-ccache-${ { steps.timestamp.outputs.now } } | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.config }}-${{ runner.python-version }}-${{ github.ref }}-ccache- | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge | ||
channel-priority: true | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set true for caching of miniconda packages to work properly! | ||
|
||
- name: Configuring Conda Environment | ||
shell: bash -l {0} | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
run: | | ||
conda config --set always_yes yes --set changeps1 no | ||
conda config --add channels conda-forge | ||
conda install conda-devenv=2 | ||
conda devenv | ||
- name: Building, Testing & Installing ThermoFun | ||
shell: bash -l {0} | ||
run: | | ||
source activate thermofun | ||
ccache -s | ||
ccache -z | ||
mkdir .build && cd .build | ||
cmake -GNinja .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} | ||
ninja | ||
ninja install | ||
python -c "import thermofun" | ||
ccache -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: windows | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
|
||
schedule: | ||
- cron: "0 5 * * 1" # runs at 05:00 UTC on Mondays | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.config }} build on ${{ matrix.os }} (Python ${{ matrix.python-version }}) | ||
runs-on: windows-2019 | ||
|
||
strategy: | ||
fail-fast: true | ||
max-parallel: 4 | ||
matrix: | ||
os: ["windows-2019"] | ||
python-version: [3.9] | ||
config: ["Release"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Timestamp # Idea from https://tinyurl.com/47wz7vpv | ||
id: timestamp | ||
shell: cmake -P {0} | ||
run: | | ||
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) | ||
message("::set-output name=now::${current_date}") | ||
- name: Configuring Cache | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
C:\Users\runneradmin\clcache | ||
C:\Users\runneradmin\conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-${{ matrix.config }}-${{ runner.python-version }}-${{ github.ref }}-clcache-${ { steps.timestamp.outputs.now } } | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.config }}-${{ runner.python-version }}-${{ github.ref }}-clcache- | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-activate-base: false | ||
allow-softlinks: true | ||
activate-environment: '' | ||
channels: conda-forge | ||
channel-priority: true | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set true for caching of miniconda packages to work properly! | ||
|
||
- name: Configuring Conda Environment | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
run: | | ||
conda config --set always_yes yes --set changeps1 no | ||
conda config --add channels conda-forge | ||
conda install conda-devenv=2 | ||
conda devenv | ||
- name: Building, Testing & Installing ThermoFun | ||
shell: cmd | ||
env: | ||
PYTHONPATH: C:\Miniconda\envs\thermofun\Library\Lib\site-packages | ||
run: | | ||
call conda activate thermofun || goto :eof | ||
clcache -s || goto :eof | ||
clcache -z || goto :eof | ||
mkdir .build && cd .build || goto :eof | ||
cmake -GNinja .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} || goto :eof | ||
ninja || goto :eof | ||
ninja install || goto :eof | ||
python -c "import thermofun" || goto :eof | ||
clcache -s || goto :eof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters