Skip to content

Commit dc3a846

Browse files
committed
Replace Travis CI with GitHub Actions
1 parent 288610a commit dc3a846

File tree

8 files changed

+242
-86
lines changed

8 files changed

+242
-86
lines changed

.github/workflows/build-and-test.yml

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
name: GitHub CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
13+
jobs:
14+
15+
linux-and-mac:
16+
# if: ${{ false }}
17+
runs-on: ${{ matrix.config.os }}
18+
name: ${{ matrix.config.os }} BUILD=${{ matrix.config.build }} CC=${{ matrix.config.cc }} CXX=${{ matrix.config.cxx }} AUTOTOOLS=${{ matrix.config.autotools }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
config:
24+
#- {os: ubuntu-16.04, build: 'static', cc: 'gcc-4.4', cxx: 'g++-4.4', autotools: 'no', cppstd: 'gnu++0x'}
25+
#- {os: ubuntu-16.04, build: 'static', cc: 'gcc-4.6', cxx: 'g++-4.6', autotools: 'no', cppstd: 'gnu++0x'}
26+
- {os: ubuntu-16.04, build: 'static', cc: 'gcc-4.7', cxx: 'g++-4.7', autotools: 'no', cppstd: 'gnu++11'}
27+
- {os: ubuntu-16.04, build: 'static', cc: 'gcc-4.8', cxx: 'g++-4.8', autotools: 'no', cppstd: 'c++11'}
28+
- {os: ubuntu-16.04, build: 'static', cc: 'gcc-5', cxx: 'g++-5', autotools: 'no', cppstd: 'c++11'}
29+
- {os: ubuntu-16.04, build: 'static', cc: 'gcc-6', cxx: 'g++-6', autotools: 'no', cppstd: 'c++11'}
30+
- {os: ubuntu-latest, build: 'static', cc: 'gcc-7', cxx: 'g++-7', autotools: 'no', cppstd: 'c++11'}
31+
- {os: ubuntu-latest, build: 'shared', cc: 'gcc', cxx: 'g++', autotools: 'yes', cppstd: 'c++11'}
32+
- {os: ubuntu-latest, build: 'static', cc: 'gcc', cxx: 'g++', autotools: 'yes', cppstd: 'c++11'}
33+
- {os: ubuntu-latest, build: 'shared', cc: 'gcc', cxx: 'g++', autotools: 'no', cppstd: 'c++11'}
34+
- {os: ubuntu-latest, build: 'static', cc: 'gcc', cxx: 'g++', autotools: 'no', cppstd: 'c++11'}
35+
- {os: ubuntu-latest, build: 'shared', cc: 'clang', cxx: 'clang++', autotools: 'yes', cppstd: 'c++11'}
36+
- {os: ubuntu-latest, build: 'static', cc: 'clang', cxx: 'clang++', autotools: 'yes', cppstd: 'c++11'}
37+
- {os: ubuntu-latest, build: 'shared', cc: 'clang', cxx: 'clang++', autotools: 'no', cppstd: 'c++11'}
38+
- {os: ubuntu-latest, build: 'static', cc: 'clang', cxx: 'clang++', autotools: 'no', cppstd: 'c++11'}
39+
- {os: macOS-latest, build: 'shared', cc: 'clang', cxx: 'clang++', autotools: 'yes', cppstd: 'c++11'}
40+
- {os: macOS-latest, build: 'static', cc: 'clang', cxx: 'clang++', autotools: 'yes', cppstd: 'c++11'}
41+
- {os: macOS-latest, build: 'shared', cc: 'clang', cxx: 'clang++', autotools: 'no', cppstd: 'c++11'}
42+
- {os: macOS-latest, build: 'static', cc: 'clang', cxx: 'clang++', autotools: 'no', cppstd: 'c++11'}
43+
44+
env:
45+
ASAN_OPTIONS: detect_odr_violation=0
46+
AUTOTOOLS: ${{ matrix.config.autotools }}
47+
COVERAGE: no
48+
BUILD: ${{ matrix.config.build }}
49+
CXX: ${{ matrix.config.cxx }}
50+
CC: ${{ matrix.config.cc }}
51+
52+
steps:
53+
- uses: actions/checkout@v2
54+
- uses: ruby/setup-ruby@v1
55+
if: matrix.config.os == 'ubuntu-16.04'
56+
with:
57+
ruby-version: 2.6
58+
- name: Install ruby hrx module
59+
if: matrix.config.os == 'ubuntu-16.04'
60+
run: sudo /opt/hostedtoolcache/Ruby/2.6.7/x64/bin/gem install hrx
61+
- name: Install ruby minitest module
62+
if: matrix.config.os == 'ubuntu-16.04'
63+
run: sudo /opt/hostedtoolcache/Ruby/2.6.7/x64/bin/gem install minitest
64+
- name: Install automake if needed (MacOS)
65+
if: runner.os == 'macOS'
66+
run: brew install automake
67+
- name: Install gcc 7 if needed
68+
if: matrix.config.cc == 'gcc-7'
69+
run: |
70+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
71+
sudo apt update
72+
sudo apt install g++-7 -y
73+
- name: Install gcc 6 if needed
74+
if: matrix.config.cc == 'gcc-6'
75+
run: |
76+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
77+
sudo apt update
78+
sudo apt install g++-6 -y
79+
- name: Install gcc 5 if needed
80+
if: matrix.config.cc == 'gcc-5'
81+
run: |
82+
sudo add-apt-repository universe
83+
sudo add-apt-repository multiverse
84+
sudo apt update
85+
sudo apt install g++-5 -y
86+
- name: Install gcc 4.8 if needed
87+
if: matrix.config.cc == 'gcc-4.8'
88+
run: |
89+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
90+
sudo apt update
91+
sudo apt install g++-4.8 -y
92+
- name: Install gcc 4.7 if needed
93+
if: matrix.config.cc == 'gcc-4.7'
94+
run: |
95+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
96+
sudo apt update
97+
sudo apt install g++-4.7 -y
98+
- name: Install gcc 4.6 if needed
99+
if: matrix.config.cc == 'gcc-4.6'
100+
run: |
101+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
102+
sudo apt update
103+
sudo apt install g++-4.6 -y
104+
- name: Install gcc 4.5 if needed
105+
if: matrix.config.cc == 'gcc-4.5'
106+
run: |
107+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
108+
sudo apt update
109+
sudo apt install g++-4.5 -y
110+
- name: Install gcc 4.4 if needed
111+
if: matrix.config.cc == 'gcc-4.4'
112+
run: |
113+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
114+
sudo apt update
115+
sudo apt install g++-4.4 -y
116+
- name: ./script/ci-install-deps
117+
env:
118+
MAKE_OPTS: LIBSASS_CPPSTD=${{ matrix.config.cppstd }}
119+
run: ./script/ci-install-deps
120+
- name: ./script/ci-install-compiler
121+
env:
122+
MAKE_OPTS: LIBSASS_CPPSTD=${{ matrix.config.cppstd }}
123+
run: ./script/ci-install-compiler
124+
- name: ./script/ci-build-libsass
125+
env:
126+
MAKE_OPTS: LIBSASS_CPPSTD=${{ matrix.config.cppstd }}
127+
run: ./script/ci-build-libsass
128+
129+
130+
windows-msvc:
131+
runs-on: windows-latest
132+
name: Windows MSVC build
133+
134+
strategy:
135+
fail-fast: false
136+
matrix:
137+
config:
138+
- {build: Release, platform: Win64}
139+
- {build: Debug, platform: Win64}
140+
- {build: Release, platform: Win32}
141+
- {build: Debug, platform: Win32}
142+
143+
steps:
144+
- name: Change git config to preserve line-endings
145+
run: |
146+
git config --system core.autocrlf false
147+
git config --system core.eol lf
148+
- uses: actions/checkout@v2
149+
- uses: ruby/setup-ruby@v1
150+
with:
151+
ruby-version: 2.6
152+
bundler-cache: true
153+
- name: Install ruby hrx module
154+
run: gem install hrx
155+
- name: Install ruby minitest module
156+
run: gem install minitest
157+
- name: Add msbuild to PATH
158+
uses: microsoft/[email protected]
159+
- name: Clone and checkout sassc repository
160+
run: git clone https://github.com/sass/sassc.git
161+
- name: Clone and checkout sass-spec repository
162+
run: git clone https://github.com/sass/sass-spec.git
163+
- name: Compile libsass ${{ matrix.config.build }} build for ${{ matrix.config.platform }}
164+
run: msbuild /m:4 /p:"Configuration=${{ matrix.config.build }};Platform=${{ matrix.config.platform }}" sassc\win\sassc.sln
165+
- name: Execute spec test runner
166+
run: ruby sass-spec/sass-spec.rb --probe-todo --impl libsass -c sassc/bin/sassc.exe -s sass-spec/spec
167+
168+
windows-mingw:
169+
runs-on: windows-latest
170+
name: Windows MinGW build
171+
172+
strategy:
173+
fail-fast: false
174+
matrix:
175+
config:
176+
- {build: shared, platform: x64}
177+
- {build: static, platform: x64}
178+
- {build: shared, platform: x86}
179+
- {build: static, platform: x86}
180+
181+
steps:
182+
- name: Change git config to preserve line-endings
183+
run: |
184+
git config --system core.autocrlf false
185+
git config --system core.eol lf
186+
- uses: actions/checkout@v2
187+
- uses: ruby/setup-ruby@v1
188+
with:
189+
ruby-version: 2.6
190+
bundler-cache: true
191+
- name: Set up MinGW
192+
uses: egor-tensin/setup-mingw@v2
193+
with:
194+
platform: ${{ matrix.config.platform }}
195+
- name: Install ruby hrx module
196+
run: gem install hrx
197+
- name: Install ruby minitest module
198+
run: gem install minitest
199+
- name: Clone and checkout sassc repository
200+
run: git clone https://github.com/sass/sassc.git
201+
- name: Clone and checkout sass-spec repository
202+
run: git clone https://github.com/sass/sass-spec.git
203+
- name: Add libsass library path to be found
204+
if: matrix.config.build == 'shared'
205+
run: echo "/d/a/libsass/libsass/lib" >> $GITHUB_PATH
206+
- name: Compile libsass ${{ matrix.config.build }} build for ${{ matrix.config.platform }}
207+
run: make ${{ matrix.config.build }} BUILD=${{ matrix.config.build }}
208+
- name: Copy library over to pass call test
209+
if: matrix.config.build == 'shared'
210+
run: copy /a/libsass/libsass/lib/libsass.dll sassc/bin/
211+
- name: Compile sassc ${{ matrix.config.build }} build for ${{ matrix.config.platform }}
212+
run: make sassc BUILD=${{ matrix.config.build }}
213+
- name: Execute spec test runner
214+
run: ruby sass-spec/sass-spec.rb --probe-todo --impl libsass -c sassc/bin/sassc.exe -s sass-spec/spec
215+
216+
217+
#- name: Install LLVM and Clang
218+
# uses: KyleMayes/[email protected]

.travis.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ ifdef LIBSASS_VERSION
5757
CXXFLAGS += -DLIBSASS_VERSION="\"$(LIBSASS_VERSION)\""
5858
endif
5959

60-
CXXFLAGS += -std=c++11
61-
LDFLAGS += -std=c++11
60+
LIBSASS_CPPSTD ?= c++11
61+
CXXFLAGS += -std=$(LIBSASS_CPPSTD)
62+
LDFLAGS += -std=$(LIBSASS_CPPSTD)
6263

6364
ifeq (Windows,$(UNAME))
6465
ifneq ($(BUILD),shared)

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ LibSass - Sass compiler written in C++
44
Currently maintained by Marcel Greter ([@mgreter]) and Michael Mifsud ([@xzyfer])
55
Originally created by Aaron Leung ([@akhleung]) and Hampton Catlin ([@hcatlin])
66

7-
[![Unix CI](https://travis-ci.org/sass/libsass.svg?branch=master)](https://travis-ci.org/sass/libsass "Travis CI")
7+
[![GitHub CI](https://github.com/sass/libsass/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/sass/libsass/actions/workflows/build-and-test.yml "GitHub CI")
88
[![Windows CI](https://ci.appveyor.com/api/projects/status/github/sass/libsass?svg=true)](https://ci.appveyor.com/project/sass/libsass/branch/master "Appveyor CI")
9-
[![Coverage Status](https://img.shields.io/coveralls/sass/libsass.svg)](https://coveralls.io/r/sass/libsass?branch=feature%2Ftest-travis-ci-3 "Code coverage of spec tests")
9+
[![Coverage Status](https://img.shields.io/coveralls/sass/libsass.svg)](https://coveralls.io/r/sass/libsass?branch=master "Code coverage of spec tests")
1010
[![Percentage of issues still open](http://isitmaintained.com/badge/open/sass/libsass.svg)](http://isitmaintained.com/project/sass/libsass "Percentage of issues still open")
1111
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/sass/libsass.svg)](http://isitmaintained.com/project/sass/libsass "Average time to resolve an issue")
1212
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=283068)](https://www.bountysource.com/trackers/283068-libsass?utm_source=283068&utm_medium=shield&utm_campaign=TRACKER_BADGE "Bountysource")

docs/build.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ Continuous Integration
6969

7070
We use two CI services to automatically test all commits against the latest [spec test-suite][5].
7171

72-
- [LibSass on Travis-CI (linux)][7]
73-
[![Build Status](https://travis-ci.org/sass/libsass.png?branch=master)](https://travis-ci.org/sass/libsass)
72+
- [LibSass on GitHub Actions (linux)][7]
73+
[![Build Status](https://github.com/sass/libsass/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/sass/libsass/actions/workflows/build-and-test.yml)
7474
- [LibSass on AppVeyor (windows)][8]
75-
[![Build status](https://ci.appveyor.com/api/projects/status/github/sass/libsass?svg=true)](https://ci.appveyor.com/project/mgreter/libsass-513/branch/master)
75+
[![Build status](https://ci.appveyor.com/api/projects/status/github/sass/libsass?svg=true)](https://ci.appveyor.com/project/sass/libsass/branch/master)
7676

7777
Why not using CMake?
7878
--
@@ -90,7 +90,7 @@ Miscellaneous
9090
[4]: build-shared-library.md
9191
[5]: https://github.com/sass/sass-spec
9292
[6]: https://github.com/sass/sassc
93-
[7]: https://github.com/sass/libsass/blob/master/.travis.yml
93+
[7]: https://github.com/sass/libsass/blob/master/.github/workflows
9494
[8]: https://github.com/sass/libsass/blob/master/appveyor.yml
9595
[9]: implementations.md
9696
[10]: build-on-darwin.md

script/ci-build-libsass

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -e
44

55
script/bootstrap
66

7+
echo Building LibSass $MAKE_OPTS
8+
79
# export this path right here (was in script/spec before)
810
export SASS_LIBSASS_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )"
911

@@ -90,8 +92,8 @@ else
9092
make $MAKE_OPTS clean
9193

9294
# Run C++ unit tests
93-
make -C test clean
94-
make -C test test
95+
make $MAKE_OPTS -C test clean
96+
make $MAKE_OPTS -C test test
9597

9698
fi
9799

script/ci-install-compiler

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
gem install minitest
4-
gem install minitap
5-
gem install rspec
6-
gem install hrx
3+
sudo gem install minitest
4+
sudo gem install minitap
5+
sudo gem install rspec
6+
sudo gem install hrx
77

8-
pip2 install --user 'requests[security]'
8+
# sudo pip2 install --user 'requests[security]'

test/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
CXX ?= c++
2-
CXXFLAGS := -I ../include/ -std=c++11 -fsanitize=address -g -O1 -fno-omit-frame-pointer
2+
3+
CXXFLAGS := -I ../include/ -g -O1 -fno-omit-frame-pointer
4+
5+
LIBSASS_CPPSTD ?= c++11
6+
CXXFLAGS += -std=$(LIBSASS_CPPSTD)
7+
LDFLAGS += -std=$(LIBSASS_CPPSTD)
38

49
test: test_shared_ptr test_util_string
510

0 commit comments

Comments
 (0)