Skip to content

Commit

Permalink
ci(header): adds actions to lint and build
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Henseler <[email protected]>
  • Loading branch information
bromiesTM committed Jul 23, 2024
1 parent 7710752 commit 0e71b0b
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/header-building.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Header Build and Create Pull Request

on:
pull_request:
branches:
- main
paths:
- 'IONOS/**'
- '!core/js/custom-elements/global-navigation/**'

jobs:
build-and-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: cd IONOS/ && npm ci

- name: Run lint
run: cd IONOS/ && npm run lint

- name: Run build
run: cd IONOS/ && npm run build

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "build(header): auto build header"
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}>
branch: auto-build-${{ github.head_ref }}-output
delete-branch: true
signoff: true
title: "Automated Build: Header for ${{ github.head_ref }}"
body: |
This pull request was automatically generated by the GitHub Actions workflow to ensure that the custom element IIFE from the 'IONOS/' subdirectory is built and integrated into the main project directory.
## Purpose
This workflow ensures that the latest changes to the custom element are always built and ready for use, preventing potential issues from unbuilt changes.
26 changes: 26 additions & 0 deletions .github/workflows/header-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Header Code Quality

on:
push:
paths:
- 'IONOS/**'

jobs:
code-quality:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Dependencies
run: cd IONOS/ && npm ci

- name: Lint Headers
run: cd IONOS/ && npm run lint

- name: Prettier
run: cd IONOS/ && npm run format:check

0 comments on commit 0e71b0b

Please sign in to comment.