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

Add front-end workflow #132

Merged
merged 10 commits into from
Jul 27, 2023
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
32 changes: 26 additions & 6 deletions .github/root-logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 26 additions & 6 deletions .github/root-logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
122 changes: 122 additions & 0 deletions .github/workflows/front-end.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: "Front-end"

# ECMAScript version: 2018
# Node.js version: 18.12
# Yarn version: 1

on:
pull_request: null
push:
branches:
- "master"
# Add [skip ci] to commit message to skip CI.

permissions:
contents: "read"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
js_syntax_errors:
name: "𝟏 JavaScript Syntax Errors"
runs-on: "ubuntu-22.04"
timeout-minutes: 5
steps:
-
name: "Checkout repository"
uses: "actions/checkout@v3"
-
name: "Set up Node.js"
uses: "actions/setup-node@v3"
with:
node-version: "18"
check-latest: true
cache: "yarn"
-
name: "Configure yarn"
run: "yarn config set engine-strict true"
-
name: "Install all dependencies"
run: "yarn install --non-interactive --pure-lockfile"
-
name: "Check JavaScript files for syntax errors"
run: |
git ls-files --cached -z -- 'resources/js/*.js' \
| xargs --null -- yarn run acorn --ecma2018 --module --silent

scss_coding_standards:
name: "𝟐 Sassy CSS Coding Standards"
runs-on: "ubuntu-22.04"
timeout-minutes: 5
steps:
-
name: "Checkout repository"
uses: "actions/checkout@v3"
-
name: "Set up Node.js"
uses: "actions/setup-node@v3"
with:
node-version: "18"
cache: "yarn"
-
name: "Configure yarn"
run: "yarn config set engine-strict true"
-
name: "Install all dependencies"
run: "yarn install --non-interactive --pure-lockfile"
-
name: "Detect coding standards violations"
run: "yarn run sass:lint --formatter github"

build:
name: "𝟑 Build"
needs:
- "js_syntax_errors"
- "scss_coding_standards"
runs-on: "ubuntu-22.04"
timeout-minutes: 5
steps:
-
name: "Checkout repository"
uses: "actions/checkout@v3"
-
name: "Set up Node.js"
uses: "actions/setup-node@v3"
with:
node-version: "18"
cache: "yarn"
-
name: "Configure yarn"
run: "yarn config set engine-strict true"
-
name: "Install production dependencies"
run: "yarn install --non-interactive --pure-lockfile"
-
name: "Build front-end"
run: "yarn run prod:build"
-
name: "Check differences to repository"
run: "git diff --exit-code"

svg:
name: "𝟓 SVG files"
runs-on: "ubuntu-22.04"
timeout-minutes: 1
steps:
-
name: "Checkout repository"
uses: "actions/checkout@v3"
-
name: "Validate SVG files"
uses: "szepeviktor/[email protected]"
with:
svg_path: "public/**/*.svg"
-
name: "Validate GitHub files"
uses: "szepeviktor/[email protected]"
with:
svg_path: ".github/**/*.svg"
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"lint:sass": "stylelint resources/sass/"
"prod:build": "vite build",
"sass:lint": "stylelint resources/sass/"
},
"dependencies": {
"acorn": "^8.10.0",
"alpinejs": "^3.12.3",
"laravel-vite-plugin": "^0.7.8",
"postcss": "^8.2.4",
Expand All @@ -19,5 +21,7 @@
"devDependencies": {
"stylelint": "^14.2.0"
},
"version": "0.0.0"
"engines": {
"node": "^18.0"
}
}
Loading
Loading