mirror of
https://github.com/owncast/owncast.git
synced 2024-11-22 12:49:37 +03:00
fe5fbea623
* Add css linter step * Add test css file * Set working directory * Only run against changed files * remove test css file * only run workflow steps if any css files were changed * commiting a file with issues * fixing file with linter warnings
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
name: CSS Lint and Formatting
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'web/**'
|
|
pull_request:
|
|
paths:
|
|
- 'web/**'
|
|
|
|
jobs:
|
|
css-lint:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./web
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get changed files
|
|
id: changed-files-yaml
|
|
uses: tj-actions/changed-files@v44
|
|
with:
|
|
path: 'web'
|
|
files_yaml: |
|
|
src:
|
|
- '**/*.{css,scss}'
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16'
|
|
|
|
- name: Install dependencies
|
|
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
|
|
run: npm install
|
|
|
|
- name: Run Prettier
|
|
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
|
|
run: npx prettier --check ${{ steps.changed-files-yaml.outputs.src_all_changed_files }}
|
|
|
|
- name: Run Stylelint
|
|
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
|
|
run: npx stylelint ${{ steps.changed-files-yaml.outputs.src_all_changed_files }}
|