From 00ea22e70ed13d5ecd71a9a9833a1679ed7fb8bc Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 11 Jun 2026 16:29:34 -0700 Subject: [PATCH] Fix workflows --- .github/workflows/docs_validation.yml | 41 +++++++++++++ .github/workflows/linting.yml | 5 +- .github/workflows/playwright.yml | 5 +- .github/workflows/publish_npm_release.yml | 9 +-- .github/workflows/publishing.yml | 28 --------- .github/workflows/pull_request_validation.yml | 58 +++++++++++++++++++ docs/docusaurus.config.js | 2 +- 7 files changed, 113 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/docs_validation.yml delete mode 100644 .github/workflows/publishing.yml create mode 100644 .github/workflows/pull_request_validation.yml diff --git a/.github/workflows/docs_validation.yml b/.github/workflows/docs_validation.yml new file mode 100644 index 00000000..41ce0d8d --- /dev/null +++ b/.github/workflows/docs_validation.yml @@ -0,0 +1,41 @@ +name: Docs Validation + +on: + pull_request: + branches: + - main + paths: + - 'docs/**' + - 'js/**' + - 'less/**' + - 'sass/**' + - 'Gruntfile.js' + - 'package.json' + - 'package-lock.json' + - '.github/workflows/docs_validation.yml' + +permissions: + contents: read + +concurrency: + group: docs-validation-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build-docs: + runs-on: ubuntu-latest + name: Build docs and check links + steps: + - uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '20.19' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build docs site + run: npm run docs:build diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index d139387d..a42327c5 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,5 +1,8 @@ name: lint -on: [push, pull_request] +on: + push: + branches: + - main jobs: run-lint: runs-on: ubuntu-latest diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 86e2e9db..afae1cc1 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,5 +1,8 @@ name: Playwright Tests -on: [push, pull_request] +on: + push: + branches: + - main jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/publish_npm_release.yml b/.github/workflows/publish_npm_release.yml index d3262350..7adcac09 100644 --- a/.github/workflows/publish_npm_release.yml +++ b/.github/workflows/publish_npm_release.yml @@ -1,22 +1,23 @@ name: Publish npm - Release on: - push: - tags: - - 'v*.*.*' + release: + types: [published] permissions: contents: read jobs: publish: + if: startsWith(github.event.release.tag_name, 'v') runs-on: ubuntu-latest name: Publish crestapps-bootstrap-select steps: - name: Get the version id: get_version run: | - VERSION="${GITHUB_REF_NAME#v}" + VERSION="${{ github.event.release.tag_name }}" + VERSION="${VERSION#v}" echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT shell: bash diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml deleted file mode 100644 index 21d63301..00000000 --- a/.github/workflows/publishing.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish NuGet - Release -on: - release: - types: [published] -jobs: - publish: - runs-on: ubuntu-latest - name: Publish NuGet package - steps: - - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: '20.19' - cache: 'npm' - - name: Install dependencies - run: npm ci - - name: Build package - run: npx grunt build - - name: Publish NuGet package - id: publish_nuget - uses: laget-se/publish-nuget@v2 - with: - NUGET_KEY: ${{ secrets.NUGET_API_KEY }} - NUSPEC_FILE: nuget/bootstrap-select.nuspec - PACKAGE_NAME: bootstrap-select - VERSION_FILE_PATH: nuget/bootstrap-select.nuspec - VERSION_REGEX: ^\s*(.*)<\/version>\s*$ diff --git a/.github/workflows/pull_request_validation.yml b/.github/workflows/pull_request_validation.yml new file mode 100644 index 00000000..cd1527d1 --- /dev/null +++ b/.github/workflows/pull_request_validation.yml @@ -0,0 +1,58 @@ +name: Pull Request Validation + +on: + pull_request: + branches: + - main + +permissions: + contents: read + +concurrency: + group: pr-validation-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + node: ['20.19', '22'] + name: Lint (Node ${{ matrix.node }}) + steps: + - uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run lint + run: npm run lint + + playwright: + runs-on: ubuntu-latest + name: Playwright + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '20.19' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Run Playwright tests + run: npm test diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 40491dbe..c161034a 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -21,7 +21,7 @@ const config = { onBrokenLinks: 'throw', markdown: { hooks: { - onBrokenMarkdownLinks: 'warn' + onBrokenMarkdownLinks: 'throw' } },