Initial version of the plugin (#1) #11
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
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - trunk | |
| pull_request: | |
| jobs: | |
| test: | |
| name: Integration tests (wp-env) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| - name: Install Node.js dependencies | |
| run: npm install | |
| # Cache the wp-env working directory (~/.wp-env) so that the WordPress | |
| # download and database setup are reused across runs when nothing changes. | |
| - name: Cache wp-env | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.wp-env | |
| key: wp-env-${{ hashFiles('package.json', '.wp-env.json') }} | |
| restore-keys: | | |
| wp-env- | |
| - name: Start wp-env | |
| run: npx wp-env start | |
| - name: Run tests | |
| run: npm test | |
| - name: Stop wp-env | |
| run: npx wp-env stop | |
| if: always() |