Merge pull request #10 from Keats/master

Add some CI
This commit is contained in:
Connor Skees 2020-05-26 13:06:54 -04:00 committed by GitHub
commit a7a4b588c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 101 additions and 3 deletions

91
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,91 @@
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: version info
run: rustc --version; cargo --version;
- name: Run all tests
run: cargo test
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
sass-spec:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: version info
run: rustc --version; cargo --version;
- name: Build binary
run: cargo b --release
- name: Get sass-spec
run: git submodule init && git submodule update
- name: Install whatever Ruby needs
run: |
sudo apt-get install libncurses5-dev libncursesw5-dev
sudo gem install bundler
cd sass-spec && bundler install
- name: Run Sass spec
run: ./sass-spec/sass-spec.rb -c './target/release/grass'

2
.gitignore vendored
View File

@ -4,3 +4,5 @@
Cargo.lock Cargo.lock
coverage coverage
pkg pkg
.idea/
!input.scss

3
input.scss Normal file
View File

@ -0,0 +1,3 @@
body {
background: red;
}

View File

@ -5,7 +5,6 @@ use codemap::{Span, Spanned};
use peekmore::PeekMoreIterator; use peekmore::PeekMoreIterator;
use crate::Cow;
use crate::common::Identifier; use crate::common::Identifier;
use crate::error::SassResult; use crate::error::SassResult;
use crate::scope::Scope; use crate::scope::Scope;
@ -15,6 +14,7 @@ use crate::utils::{
read_until_closing_paren, read_until_closing_quote, read_until_closing_square_brace, read_until_closing_paren, read_until_closing_quote, read_until_closing_square_brace,
}; };
use crate::value::Value; use crate::value::Value;
use crate::Cow;
use crate::Token; use crate::Token;
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Debug, Clone, Eq, PartialEq)]

View File

@ -1,5 +1,5 @@
use std::iter::Iterator;
use std::borrow::Borrow; use std::borrow::Borrow;
use std::iter::Iterator;
use codemap::{Span, Spanned}; use codemap::{Span, Spanned};

View File

@ -268,7 +268,9 @@ impl Value {
format!("{}{}", self.to_css_string(span)?, s), format!("{}{}", self.to_css_string(span)?, s),
QuoteKind::Quoted, QuoteKind::Quoted,
), ),
Self::Null => Value::String(self.to_css_string(span)?.into_owned(), QuoteKind::None), Self::Null => {
Value::String(self.to_css_string(span)?.into_owned(), QuoteKind::None)
}
_ => Value::String( _ => Value::String(
format!( format!(
"{}{}", "{}{}",