Skip to content

fixes #180 : Enable syntax highlight to all platform #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ matrix:
- if [[ `cargo +nightly-2017-10-09 clippy -- --version` != $CLIPPY_VERS* ]] ; then travis_wait cargo +nightly-2017-10-09 install clippy --vers "$CLIPPY_VERS" --force; fi
- export PATH=$HOME/.cargo/bin:$PATH
script:
- cargo +nightly-2017-10-09 clippy --features "syntax-highlight,sass" -- -D warnings
- cargo +nightly-2017-10-09 clippy --features "sass" -- -D warnings
- rust: stable
env: RUSTFMT=0.8.6
install:
Expand All @@ -47,9 +47,11 @@ script:
- rustc -Vv
- cargo -V
- cargo check --verbose
- cargo check --verbose --features "syntax-highlight,sass"
- cargo test --verbose
- cargo test --verbose --features "syntax-highlight,sass"
- cargo check --no-default-features --verbose
- cargo test --no-default-features --verbose
- cargo check --verbose --features "sass"
- cargo test --verbose --features "sass"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we should make it so different feature combinations run as different jobs so they can run in parallel rather than series.

Granted that can get messy, particularly when we already have problems with our rustfmt and clippy jobs (see #305)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this possible with travis?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, we just define more jobs in the matrix with a different variable set to control what happens in the job, maybe a FEATURE variable that is --feature "sass" vs --no-default-features.

Not something to include in this because it'd require a lot more experimenting and we shouldn't hold this up :)


before_deploy:
- sh ci/before_deploy.sh
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ serde_json = "1.0"
toml = "0.4.0"

[dependencies.sass-rs]
version = "0.2.0"
version = "0.2"
optional = true

[dependencies.hyper]
version = "0.10"
default-features = false

[dependencies.syntect]
version = "1.8.0"
version = "1.8"
optional = true
default-features = false
features = ["parsing", "assets", "html", "static-onig", "dump-load"]
Expand All @@ -64,7 +64,7 @@ difference = "1.0"
tempdir = "0.3"

[features]
default = []
default = ["syntax-highlight"]
unstable = []
dev = []

Expand Down
26 changes: 14 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
# Based on the "trust" template v0.1.1
# https://github.com/japaric/trust/tree/v0.1.1

os: Visual Studio 2017

environment:
global:
RUST_VERSION: stable
CRATE_NAME: cobalt
APPVEYOR_CACHE_SKIP_RESTORE: true

matrix:
# Stable channel
- TARGET: x86_64-pc-windows-gnu
CHANNEL: stable
- TARGET: i686-pc-windows-msvc
CHANNEL: stable
- TARGET: x86_64-pc-windows-msvc
CHANNEL: stable
TOOLCHAIN: msvc

# Beta channel
- TARGET: x86_64-pc-windows-msvc
CHANNEL: beta
TOOLCHAIN: msvc

install:
- ps: >-
$Env:PATH += ';C:\msys64\usr\bin'
- if "%TOOLCHAIN%" == "msvc" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- if "%TOOLCHAIN%" == "msys" set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %CHANNEL%
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin

test_script:
- rustc -Vv
- cargo -V

test_script:
# we don't run the "test phase" when doing deploys
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo check --verbose )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo test --verbose )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% build )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% test )
- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% build --no-default-features )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these still need to be build instead of check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said on gitter: because of natives C/C++ libs we need the build as check doesn't support them yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The annoying thing is that this doesn't seem to be a problem on Linux :(

- if [%APPVEYOR_REPO_TAG%]==[false] ( cargo +%CHANNEL%-%TARGET% test --no-default-features )

before_deploy:
- cargo rustc --target %TARGET% --release --bin cobalt -- -C lto
Expand Down
2 changes: 1 addition & 1 deletion ci/before_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ main() {
;;
esac

cargo rustc --target $TARGET --release --bin cobalt --features="syntax-highlight" -- -C lto
cargo rustc --target $TARGET --release --bin cobalt -- -C lto

cp target/$TARGET/release/cobalt $stage/

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern crate sass_rs;

extern crate itertools;

#[cfg(all(feature = "syntax-highlight", not(windows)))]
#[cfg(all(feature = "syntax-highlight"))]
extern crate syntect;

#[macro_use]
Expand Down