Skip to content

Commit 05203ec

Browse files
authored
Add unit test on MacOS using Github Actions (spack#14220)
- Remove macos tests from travis - Add macos tests in github actions.
1 parent 69ea6de commit 05203ec

File tree

4 files changed

+50
-22
lines changed

4 files changed

+50
-22
lines changed

.codecov.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ coverage:
44
range: 60...90
55
status:
66
project:
7-
default:
8-
threshold: 0.3%
7+
default: yes
98

109
ignore:
1110
- lib/spack/spack/test/.*
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: macos tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
jobs:
13+
build:
14+
15+
runs-on: macos-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.7]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Setup Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install Python packages
27+
run: |
28+
pip install --upgrade pip six setuptools
29+
pip install --upgrade codecov coverage==4.5.4
30+
pip install --upgrade flake8 pep8-naming
31+
- name: Setup Homebrew packages
32+
run: |
33+
brew update
34+
brew upgrade
35+
brew install gcc gnupg2 dash kcov
36+
- name: Run unit tests
37+
run: |
38+
git --version
39+
git fetch origin develop:develop
40+
. share/spack/setup-env.sh
41+
coverage run $(which spack) test
42+
coverage combine
43+
coverage xml
44+
- name: Upload to codecov.io
45+
uses: codecov/codecov-action@v1
46+
with:
47+
file: ./coverage.xml
48+
flags: unittests,macos

.travis.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ jobs:
7676
os: linux
7777
language: python
7878
env: TEST_SUITE=doc
79-
- os: osx
80-
language: generic
81-
env: [ TEST_SUITE=unit, PYTHON_VERSION=2.7, COVERAGE=true ]
82-
if: type != pull_request
8379

8480
stages:
8581
- 'style checks'
@@ -111,15 +107,6 @@ addons:
111107
- r-base-core
112108
- r-base-dev
113109
- zsh
114-
# for Mac builds, we use Homebrew
115-
homebrew:
116-
packages:
117-
- python@2
118-
- gcc
119-
- gnupg2
120-
- ccache
121-
- dash
122-
- kcov
123110
update: true
124111

125112
# ~/.ccache needs to be cached directly as Travis is not taking care of it
@@ -130,14 +117,7 @@ cache:
130117
directories:
131118
- ~/.ccache
132119

133-
# Work around Travis's lack of support for Python on OSX
134120
before_install:
135-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
136-
pip2 install --upgrade pip;
137-
pip2 install virtualenv;
138-
virtualenv venv;
139-
source venv/bin/activate;
140-
fi
141121
- ccache -M 2G && ccache -z
142122

143123
# Install various dependencies

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# <img src="https://cdn.rawgit.com/spack/spack/develop/share/spack/logo/spack-logo.svg" width="64" valign="middle" alt="Spack"/> Spack
22

3+
[![](https://github.com/spack/spack/workflows/macos%20tests/badge.svg)](https://github.com/spack/spack/actions)
34
[![Build Status](https://travis-ci.com/spack/spack.svg?branch=develop)](https://travis-ci.com/spack/spack)
45
[![Linux Builds](https://github.com/spack/spack/workflows/linux%20builds/badge.svg)](https://github.com/spack/spack/actions)
56
[![macOS Builds (nightly)](https://github.com/spack/spack/workflows/macOS%20builds%20nightly/badge.svg?branch=develop)](https://github.com/spack/spack/actions?query=workflow%3A%22macOS+builds+nightly%22)

0 commit comments

Comments
 (0)