Skip to content

Commit

Permalink
chore(workflow) add format check to ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andypf committed Jul 26, 2024
1 parent b3b04b3 commit d4f5653
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,

* @cloudoperators/greenhouse-frontend
/packages/ui-components/ @cloudoperators/greenhouse-frontend @franzheidl
* @cloudoperators/frontend-core
/packages/ui-components/ @cloudoperators/frontend-core @franzheidl
26 changes: 23 additions & 3 deletions .github/workflows/ci-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ jobs:

license-headers:
runs-on: [ubuntu-latest]
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -101,6 +98,29 @@ jobs:
- name: Run Linter
run: npm run lint

format:
needs: install-dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Specify the node version you need

- name: Cache npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install Dependencies
run: npm ci
- name: Run Prettier
run: npm run check-format

test:
needs: install-dependencies
runs-on: ubuntu-latest
Expand Down
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ The following rule governs code contributions:
- Contributions must be licensed under the [Apache 2.0 License](./LICENSE)
- Due to legal reasons, contributors will be asked to accept a Developer Certificate of Origin (DCO) when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).

## License Header

Please include the following license header at the top of every source file:

```plaintext
/*
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Juno contributors
* SPDX-License-Identifier: Apache-2.0
*/
```

## Checks

Before submitting your pull request, please ensure your code passes the following checks. These checks are also run in the CI workflow for every PR:

- **Linting**: Make sure your code adheres to the project’s coding standards by running `npm run lint`.
- **Prettier**: Ensure your code is properly formatted by running `npm run check-format`.
- **License Header**: Verify that every source file includes the correct license header as specified above.
- **Allowed Licenses**: Ensure that any dependencies added are compliant with the list of allowed licenses (see in `package.json`). Check with `npm run check-licenses`.
- **REUSE Compliance**: Ensure that your contributions are compliant with the [REUSE guidelines](./reuse/dep5).
- **Tests**: Make sure all tests pass. Run `npm run test` at the root level to ensure your code didn't break other packages.

## Issues and Planning

- We use GitHub issues to track bugs and enhancement requests.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"clean": "turbo run clean && rm -rf node_modules && rm -rf ./**/*/node_modules",
"typecheck": "turbo run typecheck",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,md}\"",
"check-format": "prettier --config ./.prettierrc --check \"**/*.{js,jsx,ts,tsx,md}\" ",
"changeset": "changeset",
"version-packages": "changeset version",
"release": "turbo run build && changeset publish"
Expand Down

0 comments on commit d4f5653

Please sign in to comment.