Skip to content

Commit 0e7d9da

Browse files
committed
unit testing for GH Actions initiated
1 parent 92baadb commit 0e7d9da

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/unittests.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This is a basic workflow to validate HTML and CSS
2+
name: HTML and CSS Validation Workflow
3+
4+
# Controls when the workflow will run
5+
on:
6+
# Triggers the workflow on push or pull request events but only for the "main" branch
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "validate_job"
17+
validate_job:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Checks out your repository under $GITHUB_WORKSPACE, so your job can access it
24+
- uses: actions/checkout@v4
25+
26+
# Sets up Node.js environment
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: '16'
31+
32+
# Installs HTMLHint and Stylelint
33+
- name: Install dependencies
34+
run: |
35+
npm install htmlhint stylelint stylelint-config-standard --save-dev
36+
37+
# Runs HTML validation
38+
- name: Validate HTML
39+
run: npx htmlhint .
40+
41+
# Runs CSS validation
42+
- name: Validate CSS
43+
run: npx stylelint "**/*.css"
44+

0 commit comments

Comments
 (0)