Skip to content

Commit

Permalink
Merge pull request #324 from molpopgen/macOS_GitHub_actions
Browse files Browse the repository at this point in the history
Mac os git hub actions
  • Loading branch information
molpopgen authored Nov 24, 2020
2 parents f3ee5e1 + c7e5a30 commit 746db43
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/tests_macOS.yml
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
5 changes: 5 additions & 0 deletions requirements/conda_minimal_deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
boost
autoconf
automake
make
gsl
1 change: 1 addition & 0 deletions requirements/conda_minimal_deps_macOS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
clangxx_osx-64

0 comments on commit 746db43

Please sign in to comment.