Skip to content
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

Linting workflow for CI #12

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
50 changes: 50 additions & 0 deletions .github/workflows/build-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow demonstrates building the website using jekyll.
# If you are just using github pages, this is not necessarily useful, but if you
# want to (for example) publish branch builds to a separate preview location,
# this can serve as a starting point for doing that.

# Unlike the pure github-pages approach, this build will also continue to work if
# you upgrade to a version of jekyll that github does not support.
name: Website Build

on:
workflow_dispatch: # you will be able to run this by pushing a button on the "Actions" tab

jobs:
build-site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Use ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6 # can change this to 2.7 or whatever version you prefer
- name: Cache npm local files
uses: actions/cache@v2
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json', 'package.json') }}
- name: Cache ruby gems
uses: actions/cache@v1
with:
path: ~/bundle-cache
key: ${{ runner.os }}-gem-bundle-${{ hashFiles('Gemfile', 'Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle config
run: bundle config path ~/bundle-cache
- name: Dependencies
run: npm install
- name: Build
run: npm run-script build
- name: Upload built website to github
uses: actions/upload-artifact@v2
with:
name: static-site
path: _site
67 changes: 67 additions & 0 deletions .github/workflows/smoketest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Smoketest/code lint checks for Jekyll site

name: Smoke Tests

# Controls when the action will run. Triggers the workflow on pull request
# events but only for the master branch
on:
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
jekyll-lint:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Use ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6 # can change this to 2.7 or whatever version you prefer
- name: Cache npm local files
uses: actions/cache@v2
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json', 'package.json') }}
- name: Cache ruby gems
uses: actions/cache@v1
with:
path: ~/bundle-cache
key: ${{ runner.os }}-gem-bundle-${{ hashFiles('Gemfile', 'Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle config
run: bundle config path ~/bundle-cache
- name: Node and Ruby setup
run: npm install
- name: Check jekyll configuration
run: npm run-script hyde
source-lint:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Cache npm local files
uses: actions/cache@v2
with:
path: |
~/.npm
./node_modules
key: npm-${{ hashFiles('frontend/package-lock.json', 'frontend/package.json') }}
- name: Node setup
run: npm install
env:
SKIP_BUNDLE: true
- name: Lint
run: npm run-script lint
74 changes: 74 additions & 0 deletions .htmllintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"plugins": [], // npm modules to load

"maxerr": false,
"raw-ignore-regex": false,
"attr-bans": [
"align",
"background",
"bgcolor",
"border",
"frameborder",
"longdesc",
"marginwidth",
"marginheight",
"scrolling",
"style",
"width"
],
"indent-delta": false,
"indent-style": "nonmixed",
"indent-width": 2,
"indent-width-cont": false,
"spec-char-escape": true,
"text-ignore-regex": false,
"tag-bans": [
"style",
"b",
"i"
],
"tag-close": true,
"tag-name-lowercase": true,
"tag-name-match": true,
"tag-self-close": false,
"doctype-first": false,
"doctype-html5": false,
"attr-name-style": "dash",
"attr-name-ignore-regex": false,
"attr-no-dup": true,
"attr-no-unsafe-char": true,
"attr-order": false,
"attr-quote-style": "double",
"attr-req-value": true,
"attr-new-line": false,
"attr-validate": true,
"id-no-dup": true,
"id-class-no-ad": true,
"id-class-style": false,
"class-no-dup": true,
"class-style": false,
"id-class-ignore-regex": false,
"img-req-alt": "allownull",
"img-req-src": true,
"html-valid-content-model": true,
"head-valid-content-model": true,
"href-style": false,
"link-req-noopener": true,
"label-req-for": true,
"line-end-style": "lf",
"line-no-trailing-whitespace": true,
"line-max-len": false,
"line-max-len-ignore-regex": false,
"head-req-title": true,
"title-no-dup": true,
"title-max-len": 60,
"html-req-lang": false,
"lang-style": "case",
"fig-req-figcaption": false,
"focusable-tabindex-style": false,
"input-radio-req-name": true,
"input-req-label": false,
"table-req-caption": false,
"table-req-header": false,
"tag-req-attr": false
}
7 changes: 7 additions & 0 deletions .sasslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
options:
max-warnings: 10
files:
include: 'assets/stylesheets/**/*.scss'
rules:
no-css-comments: 0
no-empty-rulesets: 1
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ description: > # this means to ignore newlines until "baseurl:"
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
# You will want to change this!
url: "http://localhost:4000" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll

Expand Down
3 changes: 2 additions & 1 deletion _layouts/application.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<head>
<meta charset="utf-8">
{% comment %} <!-- htmllint head-req-title="false" --> {% endcomment %}
{% include _head.html %}
</head>
<body>
Expand Down
84 changes: 42 additions & 42 deletions assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,72 @@
// ----------------------------------------
// USWDS THEME

@import "../uswds-theme/uswds-theme-general";
@import "../uswds-theme/uswds-theme-typography";
@import "../uswds-theme/uswds-theme-spacing";
@import "../uswds-theme/uswds-theme-color";
@import "../uswds-theme/uswds-theme-utilities";
@import "../uswds-theme/uswds-theme-components";
@import '../uswds-theme/uswds-theme-general';
@import '../uswds-theme/uswds-theme-typography';
@import '../uswds-theme/uswds-theme-spacing';
@import '../uswds-theme/uswds-theme-color';
@import '../uswds-theme/uswds-theme-utilities';
@import '../uswds-theme/uswds-theme-components';

//----------------------------------------
// USWDS
// Includes all USWDS SCSS
// Comment out if using individual components

@import "../../node_modules/uswds/src/stylesheets/uswds.scss";
@import '../../node_modules/uswds/src/stylesheets/uswds';

// ----------------------------------------
// USWDS INDIVIDUAL PACKAGES
// Comment out if using all components

// Required
// @import "./node_modules/uswds/src/stylesheets/packages/required";
// @import "./node_modules/uswds/src/stylesheets/packages/global";
// @import "./node_modules/uswds/src/stylesheets/base/accessibility";
// @import './node_modules/uswds/src/stylesheets/packages/required';
// @import './node_modules/uswds/src/stylesheets/packages/global';
// @import './node_modules/uswds/src/stylesheets/base/accessibility';

// Optional
// @import "./node_modules/uswds/src/stylesheets/packages/form-controls";
// @import "./node_modules/uswds/src/stylesheets/packages/form-templates";
// @import "./node_modules/uswds/src/stylesheets/packages/layout-grid";
// @import "./node_modules/uswds/src/stylesheets/packages/typography";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-accordion";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-alert";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-banner";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-breadcrumb";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-button-group";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-button";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-card";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-checklist";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-footer";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-header";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-hero";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-media-block";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-megamenu";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-nav-container";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-nav";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-navbar";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-search";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-sidenav";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-skipnav";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-table";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-tag";
// @import "./node_modules/uswds/src/stylesheets/packages/usa-tooltip";
// @import "./node_modules/uswds/src/stylesheets/packages/uswds-fonts";
// @import "./node_modules/uswds/src/stylesheets/packages/uswds-utilities";
// @import "./node_modules/uswds/src/stylesheets/packages/validation";
// @import './node_modules/uswds/src/stylesheets/packages/form-controls';
// @import './node_modules/uswds/src/stylesheets/packages/form-templates';
// @import './node_modules/uswds/src/stylesheets/packages/layout-grid';
// @import './node_modules/uswds/src/stylesheets/packages/typography';
// @import './node_modules/uswds/src/stylesheets/packages/usa-accordion';
// @import './node_modules/uswds/src/stylesheets/packages/usa-alert';
// @import './node_modules/uswds/src/stylesheets/packages/usa-banner';
// @import './node_modules/uswds/src/stylesheets/packages/usa-breadcrumb';
// @import './node_modules/uswds/src/stylesheets/packages/usa-button-group';
// @import './node_modules/uswds/src/stylesheets/packages/usa-button';
// @import './node_modules/uswds/src/stylesheets/packages/usa-card';
// @import './node_modules/uswds/src/stylesheets/packages/usa-checklist';
// @import './node_modules/uswds/src/stylesheets/packages/usa-footer';
// @import './node_modules/uswds/src/stylesheets/packages/usa-header';
// @import './node_modules/uswds/src/stylesheets/packages/usa-hero';
// @import './node_modules/uswds/src/stylesheets/packages/usa-media-block';
// @import './node_modules/uswds/src/stylesheets/packages/usa-megamenu';
// @import './node_modules/uswds/src/stylesheets/packages/usa-nav-container';
// @import './node_modules/uswds/src/stylesheets/packages/usa-nav';
// @import './node_modules/uswds/src/stylesheets/packages/usa-navbar';
// @import './node_modules/uswds/src/stylesheets/packages/usa-search';
// @import './node_modules/uswds/src/stylesheets/packages/usa-sidenav';
// @import './node_modules/uswds/src/stylesheets/packages/usa-skipnav';
// @import './node_modules/uswds/src/stylesheets/packages/usa-table';
// @import './node_modules/uswds/src/stylesheets/packages/usa-tag';
// @import './node_modules/uswds/src/stylesheets/packages/usa-tooltip';
// @import './node_modules/uswds/src/stylesheets/packages/uswds-fonts';
// @import './node_modules/uswds/src/stylesheets/packages/uswds-utilities';
// @import './node_modules/uswds/src/stylesheets/packages/validation';

// ----------------------------------------
// USWDS THEME CUSTOM STYLES

@import "../uswds-theme/uswds-theme-custom-styles";
@import '../uswds-theme/uswds-theme-custom-styles';

// ----------------------------------------
// CORE
// Styles specific to your app

@import "core/base";
@import 'core/base';

// ----------------------------------------
// Demo - Delete this line and import statement when you begin

@import "demo/demo";
@import 'demo/demo';
5 changes: 3 additions & 2 deletions assets/stylesheets/core/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
App-specific styles here
----------------------------------------
*/
// remove this when you actually add rules here
// sass-lint:disable no-empty-rulesets
html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

}
12 changes: 6 additions & 6 deletions assets/stylesheets/demo/demo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ folder (demo) when you start your project.
*/

body {
background-color: color($theme-color-primary-darker);
background-color: color($theme-color-primary-darker);
}

.demo-container {
display: grid;
height: 100vh;
justify-content: center;
align-content: center;
color: color($theme-color-accent-cool-lighter);
align-content: center;
color: color($theme-color-accent-cool-lighter);
display: grid;
height: 100vh;
justify-content: center;
}
Loading