Skip to content

Implement GitHub Actions for HTML/CSS Validation #1

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Calimix
Copy link
Owner

@Calimix Calimix commented Jul 4, 2025

Explanation:
Workflow Name: Indicates that this workflow is for validating HTML and CSS.
Triggers: The workflow runs on pushes and pull requests to the main branch, as well as manually.
Job: A single job named validate runs on Ubuntu.

Steps:

  • Check out the code from the repository.
  • Set up Node.js.
  • Install the necessary packages for HTML and CSS validation tools.
  • Run HTML validation with HTMLHint.
  • Run CSS validation with Stylelint.

@Calimix
Copy link
Owner Author

Calimix commented Jul 4, 2025

Integrate pnpm for HTML and CSS Validation in GitHub Actions

Key Addition:
Caching Step: The Cache pnpm step caches the pnpm store, speeding up future runs.

@Calimix
Copy link
Owner Author

Calimix commented Jul 4, 2025

Integrate pnpm for HTML and CSS Validation in GitHub Actions

Key Additions:

  1. Caching Step: The Cache pnpm step caches the pnpm store, speeding up future runs. (previous implementation)

  2. Error Handling with set -e: This ensures that the script exits immediately if any command fails.

  3. Logging Errors:

  • HTML validation errors are logged to html_validation_errors.log.
  • CSS validation errors are logged to css_validation_errors.log.
  1. Error Check: After each validation step, the script checks if the log file is empty. If it contains errors, a message is printed, and the workflow exits with a non-zero status.

This setup will help track validation issues effectively while ensuring the workflow fails on errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant