-
Notifications
You must be signed in to change notification settings - Fork 11
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 #324 from molpopgen/macOS_GitHub_actions
Mac os git hub actions
- Loading branch information
Showing
3 changed files
with
99 additions
and
0 deletions.
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,93 @@ | ||
name: macOS tests | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main, dev] | ||
|
||
jobs: | ||
test: | ||
name: Build and run tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python: [ 3.8 ] | ||
os: [ macos-latest ] | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.ACTIONS }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Cache conda and dependancies | ||
id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
/usr/share/miniconda/envs/anaconda-client-env | ||
~/osx-conda | ||
~/.bashrc | ||
key: ${{ runner.os }}-${{ matrix.python }}-conda-v1-${{ hashFiles('requirements/conda_minimal_deps.txt') }} | ||
|
||
- name: Install Conda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
with: | ||
activate-environment: anaconda-client-env | ||
python-version: ${{ matrix.python }} | ||
channels: conda-forge | ||
channel-priority: strict | ||
auto-update-conda: true | ||
use-only-tar-bz2: true | ||
|
||
- name: Install conda deps | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
shell: bash -l {0} #We need a login shell to get conda | ||
run: | | ||
conda install --yes --file=requirements/conda_minimal_deps_${{ runner.os }}.txt | ||
conda install --yes --file=requirements/conda_minimal_deps.txt | ||
- name: Fix OSX Cache Write #OSX Won't let the cache restore due to file perms | ||
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' | ||
run: | | ||
cp -r /usr/local/miniconda/envs/anaconda-client-env ~/osx-conda | ||
- name: Fix OSX Cache Restore | ||
if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest' | ||
run: | | ||
mkdir -p /usr/local/miniconda/envs | ||
sudo cp -r ~/osx-conda /usr/local/miniconda/envs/anaconda-client-env | ||
- name: Init conda | ||
shell: bash -l {0} | ||
run: | | ||
conda init bash | ||
- name: Fix OSX profile | ||
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' | ||
run: | | ||
cp ~/.bash_profile ~/.bashrc | ||
- name: Configure and build | ||
# shell: bash -l {0} | ||
run: | | ||
# conda init bash | ||
source ~/.bashrc | ||
conda activate anaconda-client-env | ||
autoreconf --install | ||
./configure | ||
make -j 3 | ||
- name: Run C++ tests | ||
run: | | ||
source ~/.bashrc | ||
conda activate anaconda-client-env | ||
make check -j 2 |
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,5 @@ | ||
boost | ||
autoconf | ||
automake | ||
make | ||
gsl |
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 @@ | ||
clangxx_osx-64 |