Committed 20250130-yarafie-massive-update #771
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI - PR | |
'on': | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Run Linters | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.JS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Cache node modules | |
uses: actions/cache@v4.2.0 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Website - Install dependencies | |
run: cd website && npm ci | |
- id: yamllint | |
name: Yamllint | |
uses: reviewdog/action-yamllint@v1 | |
with: | |
github_token: ${{ secrets.github_token }} | |
reporter: github-pr-check | |
yamllint_flags: '.' | |
fail_level: error | |
filter_mode: nofilter | |
continue-on-error: true | |
- id: eslint | |
name: ESLint | |
uses: reviewdog/action-eslint@v1.33 | |
with: | |
github_token: ${{ secrets.github_token }} | |
reporter: github-pr-check | |
eslint_flags: --ext js,jsx . | |
fail_level: error | |
filter_mode: nofilter | |
workdir: website | |
continue-on-error: true | |
- if: ${{ steps.yamllint.outcome == 'failure' }} | |
run: echo "yamllint" >> results.txt | |
- if: ${{ steps.eslint.outcome == 'failure' }} | |
run: echo "eslint" >> results.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: lint | |
path: results.txt | |
retention-days: 5 | |
if-no-files-found: ignore | |
- name: Report linters error | |
if: ${{ steps.yamllint.outcome == 'failure' || steps.eslint.outcome == 'failure' }} | |
run: exit 1 | |
format-lint: | |
name: Run formatters to check code formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.JS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Cache node modules | |
uses: actions/cache@v4.2.0 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Website - Install dependencies | |
run: cd website && npm ci | |
- id: prettier | |
name: Prettier Check | |
uses: creyD/prettier_action@v4.3 | |
with: | |
dry: true | |
prettier_options: --write . | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
- if: ${{ always() && steps.prettier.outcome == 'failure' }} | |
run: echo "prettier" >> results.txt | |
- if: ${{ always() && steps.prettier.outcome == 'failure' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: format-lint | |
path: results.txt | |
if-no-files-found: ignore | |
build: | |
name: Check website build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.JS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Cache node modules | |
uses: actions/cache@v4.2.0 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Website - Install dependencies | |
run: cd website && npm ci | |
- name: Website - Build | |
run: cd website && npm run build | |
changes: | |
name: Analyze changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
list-files: json | |
filters: | | |
blueprints: | |
- 'blueprints/**/*.yaml' | |
- if: ${{ steps.changes.outputs.blueprints == 'true' }} | |
id: blueprints_urls | |
env: | |
FILES: ${{ steps.changes.outputs.blueprints_files }} | |
REPO: ${{ github.event.pull_request.head.repo.full_name }} | |
run: | | |
mapfile -t files < <( jq '.[]' < <(echo ${FILES}) ) | |
for f in ${files[@]}; do echo "https://github.com/${REPO}/blob/${GITHUB_HEAD_REF}/$(echo $f | tr -d '"')" >> blueprints.txt; done | |
- env: | |
PR_NUM: ${{ github.event.number }} | |
run: echo $PR_NUM > pr_num.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: changes | |
path: blueprints.txt | |
retention-days: 5 | |
if-no-files-found: ignore | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: changes | |
path: pr_num.txt | |
retention-days: 5 |