chore(deps): update dependency @types/semver to v7.5.7 #1407
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: 'Build and Test' | |
on: | |
push: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') || github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
disable-sudo: true | |
disable-file-monitoring: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
github.com:443 | |
nodejs.org:443 | |
registry.npmjs.org:443 | |
- name: Check out the source code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version-file: package.json | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run all | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.wordpress.org:80 | |
api.wordpress.org:443 | |
wordpress.org:443 | |
develop.svn.wordpress.org:443 | |
plugins.svn.wordpress.org:443 | |
github.com:443 | |
- name: Check out the source code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Set up WordPress and WordPress Test Library | |
uses: ./ | |
with: | |
version: latest | |
dir: /tmp | |
- name: Verify | |
run: | | |
test -e /tmp/wordpress | |
test -e /tmp/wordpress-tests-lib | |
test -f /tmp/wordpress-tests-lib/wp-tests-config.php | |
integration: | |
name: Integration testing | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mariadb:latest | |
ports: | |
- '3306:3306' | |
env: | |
MYSQL_ROOT_PASSWORD: wordpress | |
MARIADB_INITDB_SKIP_TZINFO: 1 | |
MYSQL_USER: wordpress | |
MYSQL_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress_test | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
api.wordpress.org:80 | |
api.wordpress.org:443 | |
wordpress.org:443 | |
develop.svn.wordpress.org:443 | |
plugins.svn.wordpress.org:443 | |
github.com:443 | |
objects.githubusercontent.com:443 | |
packagist.org:443 | |
- name: Check out the source code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # 2.29.0 | |
with: | |
coverage: none | |
php-version: "8.0" | |
- name: Install PHP Dependencies | |
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # 2.2.0 | |
with: | |
working-directory: wptest | |
- name: Set up WordPress and WordPress Test Library | |
uses: ./ | |
with: | |
version: latest | |
- name: Verify MariaDB connection | |
run: | | |
while ! mysqladmin ping -h 127.0.0.1 -P ${{ job.services.mysql.ports[3306] }} --silent; do | |
sleep 1 | |
done | |
timeout-minutes: 1 | |
- name: Run tests | |
run: vendor/bin/phpunit | |
working-directory: wptest | |
check-dist: | |
name: Check dist | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
disable-sudo: true | |
disable-file-monitoring: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
github.com:443 | |
nodejs.org:443 | |
registry.npmjs.org:443 | |
- name: Check out the source code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
token: ${{ secrets.REPOSITORY_ACCESS_TOKEN }} | |
- name: Setup Node.js environment | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version-file: package.json | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Rebuild the dist/ directory | |
run: npm run package | |
- name: Check the diff | |
run: | | |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then | |
echo "::warning::There are changes in the built files." | |
if [ "${{ github.event.head_commit.committer.email }}" != "[email protected]" ]; then | |
git config user.name "GitHub Actions" | |
git config user.email [email protected] | |
git config push.default "current" | |
git add dist/ | |
git commit -m "chore: regenerate dist" | |
git push | |
else | |
echo "::error::Aborting to avoid the loop." | |
exit 1 | |
fi | |
fi |