Repository navigation
chore: ci - clear workflow shellcheck debt and fix consumption examples #3483
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b18c516
Clear workflow shellcheck debt and fix consumption examples (#3478)
eleshar 4a23711
fix(ci): fail artifact pruning on errors and order by filename (#3478)
eleshar afb6a4b
Merge branch 'develop' into chore/ci-hygiene-3478
eleshar b747990
Merge branch 'develop' into chore/ci-hygiene-3478
eleshar 17fac70
docs(examples): make the scaffold CI examples runnable on a clean rep…
eleshar 488cc86
Merge branch 'develop' into chore/ci-hygiene-3478
eleshar 26d754f
Merge branch 'develop' into chore/ci-hygiene-3478
eleshar d09fee8
Merge branch 'develop' into chore/ci-hygiene-3478
eleshar 0e49302
Merge remote-tracking branch 'origin/develop' into HEAD
eleshar 68068ee
Merge remote-tracking branch 'origin/develop' into HEAD
eleshar 7afa907
Merge remote-tracking branch 'origin/develop' into chore/ci-hygiene-3478
eleshar fdfe752
fix(ci): take filename-ordered prune from #3483 over develop's mtime …
eleshar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
91 changes: 35 additions & 56 deletions
91
.github/examples/workflow-consumption-wordpress-plugin.yml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,81 +1,60 @@ | ||
| # Example: Using LightSpeed reusable workflows in a WordPress block plugin | ||
| # Example: CI for a WordPress block plugin | ||
| # | ||
| # Place this in: .github/workflows/ci.yml (in your wordpress-block-plugin repo) | ||
| # Place this in: .github/workflows/ci.yml (in your plugin repo, e.g. one | ||
| # generated from lightspeedwp/block-plugin-scaffold). | ||
| # | ||
| # This example shows how to consume reusable workflows from lightspeedwp/.github | ||
| # - Every action is pinned to a full commit SHA with its version as a | ||
| # comment; let Dependabot (github-actions ecosystem) keep the pins current. | ||
| # - `npm ci` and the npm cache need a committed `package-lock.json`. The | ||
| # scaffold's .gitignore excludes it: remove that line, run `npm install` | ||
| # and commit the lockfile before enabling this workflow. | ||
| # - Organisation reusable workflows from lightspeedwp/.github are not | ||
| # available yet (tracked in #3480). Once they are, call them with | ||
| # `uses: lightspeedwp/.github/.github/workflows/<file>.yml@<sha>`. | ||
|
|
||
| name: Plugin CI/CD | ||
| name: Plugin CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| paths: | ||
| - '**.js' | ||
| - '**.php' | ||
| - 'package.json' | ||
| - 'composer.json' | ||
| pull_request: | ||
| branches: [main, develop] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| # Run AI feedback validation on PRs | ||
| ai-feedback: | ||
| if: github.event_name == 'pull_request' | ||
| uses: lightspeedwp/.github/workflows/ai-feedback-validation@main | ||
| with: | ||
| context: wordpress-plugin | ||
| severity: warning | ||
| secrets: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| # Run integration tests using PR creation agent | ||
| integration-tests: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: npm | ||
| - uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '8.1' | ||
| permissions: | ||
| contents: read | ||
|
|
||
| # Use the reusable workflow if it supports your test setup | ||
| - name: Run integration tests | ||
| uses: lightspeedwp/.github/workflows/pr-creation-agent-integration-tests@main | ||
| secrets: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| concurrency: | ||
| group: ci-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| # PHP linting | ||
| jobs: | ||
| php-lint: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: shivammathur/setup-php@v2 | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| php-version: '8.1' | ||
| - run: composer install | ||
| persist-credentials: false | ||
| - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 | ||
| with: | ||
| # Use a PHP release in active support that your plugin supports. | ||
| php-version: '8.4' | ||
| tools: composer | ||
| - run: composer install --no-interaction --no-progress | ||
| - run: composer run lint | ||
|
|
||
| # JavaScript linting | ||
| js-lint: | ||
| js-lint-and-test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm ci --ignore-scripts --no-audit --no-fund | ||
| - run: npm run lint | ||
|
|
||
| # Phase progression (on main branch pushes) | ||
| update-phase: | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| uses: lightspeedwp/.github/workflows/orchestrate-phase-progression@main | ||
| with: | ||
| repo-context: wordpress-plugin | ||
| secrets: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - run: npm test |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.