Skip to content

Commit

Permalink
Merge pull request #14 from a8cteam51/feature/js-css-cs-workflow
Browse files Browse the repository at this point in the history
Add JS/CSS coding standard workflow
  • Loading branch information
ahegyes authored Mar 29, 2024
2 parents d3cc507 + c83c09d commit a7fb1db
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/js-css-coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: JS+CSS Coding Standards

on:
push:
branches: [ trunk, develop ]
pull_request:
branches: [ trunk, develop ]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup proper Node.js version
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm''
- name: Install dependencies
run: npm ci
- name: Run JS linter
run: npm run lint:scripts
- name: Run CSS linter
run: npm run lint:styles
4 changes: 2 additions & 2 deletions .github/workflows/php-coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
Expand All @@ -31,7 +31,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php-syntax-errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup proper PHP version
uses: shivammathur/setup-php@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,37 @@

// Media query "greater than $breakpoint".
@mixin breakpoint-up($breakpoint) {

@if map.has-key($breakpoints, $breakpoint) {
$breakpoint-value: map.get($breakpoints, $breakpoint);

@media (min-width: $breakpoint-value) {
@content;
}
} @else {

@warn "Undefined Breakpoint: (#{$breakpoint}). Available breakpoints: #{map.keys($breakpoints)}";
}
}

// Media query "less than $breakpoint".
@mixin breakpoint-down($breakpoint) {

@if map.has-key($breakpoints, $breakpoint) {
$breakpoint-value: map.get($breakpoints, $breakpoint);

@media (max-width: ($breakpoint-value - 1)) {
@content;
}
} @else {

@warn "Undefined Breakpoint: (#{$breakpoint}). Available breakpoints: #{map.keys($breakpoints)}";
}
}

// Media query "between $a and $b".
@mixin breakpoint-between($a, $b) {

@if map.has-key($breakpoints, $a) and map.has-key($breakpoints, $b) {
$breakpoint-a: map.get($breakpoints, $a);
$breakpoint-b: map.get($breakpoints, $b);
Expand All @@ -37,10 +42,14 @@
@content;
}
} @else {

@if (map.has-key($breakpoints, $a) == false) {

@warn "Undefined Breakpoint: #{$a}. Available breakpoints: #{map.keys($breakpoints)}";
}

@if (map.has-key($breakpoints, $b) == false) {

@warn "Undefined Breakpoint: #{$b}. Available breakpoints: #{map.keys($breakpoints)}";
}
}
Expand Down

0 comments on commit a7fb1db

Please sign in to comment.