Update GitHub actions/setup-node and add optionalDependencies handling (https://github.com/woocommerce/woocommerce-blocks/pull/6032)
* Update actions/setup-node to v2 and to use ,nvmrc file * Fix order of actions for Bundle Size workflow * Use actions/setup-node cache instead of actions/cache + ensure we always install with npm ci * restore linting setup job to cache npm * Don't install ndb in CI Move ndb package to optionalDependencies and update the CI workflows to not install optional dependencies * Update actions/setup-node to v3 * Update actions/checkout to v3 * Update download and upload-artifact actions to v3 * Update actions/stale to v5
This commit is contained in:
parent
937bab7688
commit
e1ae6b4552
|
@ -16,7 +16,7 @@ jobs:
|
|||
name: Add Milestone
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Latest milestone
|
||||
uses: woocommerce/automations@v1
|
||||
with:
|
||||
|
|
|
@ -7,10 +7,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@v2-beta
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
- uses: preactjs/compressed-size-action@v2
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
|
|
|
@ -7,30 +7,20 @@ jobs:
|
|||
build-trunk:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: trunk
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
- name: Use Node.js 16.13.2
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.13.2
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: npm install and build
|
||||
run: |
|
||||
npm ci
|
||||
npm ci --no-optional
|
||||
npm run build:check-assets
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: assets-list
|
||||
path: ./build/assets.json
|
||||
|
@ -39,28 +29,18 @@ jobs:
|
|||
needs: [build-trunk]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
- name: Use Node.js 16.13.2
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.13.2
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: npm install
|
||||
run: |
|
||||
npm ci
|
||||
npm ci --no-optional
|
||||
npm run build:check-assets
|
||||
- name: Download assets (trunk)
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: assets-list
|
||||
path: assets-list
|
||||
|
|
|
@ -9,7 +9,7 @@ jobs:
|
|||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-stale: 60
|
||||
|
|
|
@ -3,69 +3,69 @@
|
|||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
name: "CodeQL"
|
||||
name: 'CodeQL'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [trunk]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [trunk]
|
||||
schedule:
|
||||
- cron: '0 16 * * 4'
|
||||
push:
|
||||
branches: [trunk]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [trunk]
|
||||
schedule:
|
||||
- cron: '0 16 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Override automatic language detection by changing the below list
|
||||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
|
||||
language: ['javascript']
|
||||
# Learn more...
|
||||
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Override automatic language detection by changing the below list
|
||||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
|
||||
language: ['javascript']
|
||||
# Learn more...
|
||||
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
|
|
|
@ -6,22 +6,20 @@ on:
|
|||
branches: [trunk]
|
||||
|
||||
jobs:
|
||||
# cache node and modules
|
||||
Setup:
|
||||
name: Setup for Jobs
|
||||
name: Setup
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
- name: Install Node Dependencies
|
||||
run: npm install
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: Install Node dependencies
|
||||
run: npm ci --no-optional
|
||||
|
||||
JSLintingCheck:
|
||||
name: Lint JavaScript
|
||||
|
@ -29,27 +27,24 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
- name: Install Node Dependencies
|
||||
run: npm install
|
||||
- name: Save Code Linting Report JSON
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: Install Node dependencies
|
||||
run: npm ci --no-optional
|
||||
- name: Save code linting report JSON
|
||||
run: npm run lint:js:report
|
||||
# Continue to the next step even if this fails
|
||||
continue-on-error: true
|
||||
- name: Upload ESLint report
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: eslint_report.json
|
||||
path: eslint_report.json
|
||||
- name: Annotate Code Linting Results
|
||||
- name: Annotate code linting results
|
||||
uses: ataylorme/eslint-annotate-action@1.2.0
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
|
@ -61,16 +56,13 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
- name: Install Node Dependencies
|
||||
run: npm install
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: Install Node dependencies
|
||||
run: npm ci --no-optional
|
||||
- name: Lint CSS
|
||||
run: npm run lint:css
|
||||
|
|
|
@ -1,63 +1,63 @@
|
|||
name: PHP Coding Standards
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- trunk
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- trunk
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
# Runs PHP coding standards checks.
|
||||
# Note: Inspired by https://github.com/WordPress/wordpress-develop/blob/master/.github/workflows/coding-standards.yml
|
||||
#
|
||||
# Violations are reported inline with annotations.
|
||||
#
|
||||
# Performs the following steps:
|
||||
# - Checks out the repository.
|
||||
# - Configures caching for Composer.
|
||||
# - Sets up PHP.
|
||||
# - Logs debug information.
|
||||
# - Installs Composer dependencies (from cache if possible).
|
||||
# - Logs PHP_CodeSniffer debug information.
|
||||
# - Runs PHPCS on the full codebase with warnings suppressed.
|
||||
# - todo: Configure Slack notifications for failing scans.
|
||||
phpcs:
|
||||
name: PHP coding standards
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
# Runs PHP coding standards checks.
|
||||
# Note: Inspired by https://github.com/WordPress/wordpress-develop/blob/master/.github/workflows/coding-standards.yml
|
||||
#
|
||||
# Violations are reported inline with annotations.
|
||||
#
|
||||
# Performs the following steps:
|
||||
# - Checks out the repository.
|
||||
# - Configures caching for Composer.
|
||||
# - Sets up PHP.
|
||||
# - Logs debug information.
|
||||
# - Installs Composer dependencies (from cache if possible).
|
||||
# - Logs PHP_CodeSniffer debug information.
|
||||
# - Runs PHPCS on the full codebase with warnings suppressed.
|
||||
# - todo: Configure Slack notifications for failing scans.
|
||||
phpcs:
|
||||
name: PHP coding standards
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
- name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Set up Composer caching
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-composer-dependencies
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
coverage: none
|
||||
tools: composer, cs2pr
|
||||
- name: Set up Composer caching
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-composer-dependencies
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
coverage: none
|
||||
tools: composer, cs2pr
|
||||
|
||||
- name: Log debug information
|
||||
run: |
|
||||
php --version
|
||||
composer --version
|
||||
- name: Install Composer dependencies
|
||||
run: |
|
||||
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
|
||||
echo "${PWD}/vendor/bin" >> $GITHUB_PATH
|
||||
- name: Log PHPCS debug information
|
||||
run: phpcs -i
|
||||
- name: Log debug information
|
||||
run: |
|
||||
php --version
|
||||
composer --version
|
||||
- name: Install Composer dependencies
|
||||
run: |
|
||||
composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
|
||||
echo "${PWD}/vendor/bin" >> $GITHUB_PATH
|
||||
- name: Log PHPCS debug information
|
||||
run: phpcs -i
|
||||
|
||||
- name: Run PHPCS on all files
|
||||
run: phpcs ./src -q -n --report=checkstyle | cs2pr
|
||||
- name: Run PHPCS on all files
|
||||
run: phpcs ./src -q -n --report=checkstyle | cs2pr
|
||||
|
|
|
@ -10,28 +10,15 @@ jobs:
|
|||
name: JavaScript E2E Tests (WP latest with Gutenberg plugin)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
|
||||
- name: Use Node.js 16.13.2
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.13.2
|
||||
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: Npm install and build
|
||||
run: |
|
||||
npm ci
|
||||
npm ci --no-optional
|
||||
FORCE_REDUCED_MOTION=true npm run build:e2e-test
|
||||
|
||||
- name: blocks.ini setup
|
||||
|
@ -72,7 +59,7 @@ jobs:
|
|||
|
||||
- name: Upload artifacts on failure
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: e2e-with-gutenberg-test-report
|
||||
path: reports/e2e
|
||||
|
@ -81,28 +68,15 @@ jobs:
|
|||
name: JavaScript E2E Tests (latest)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
|
||||
- name: Use Node.js 16.13.2
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.13.2
|
||||
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: Npm install and build
|
||||
run: |
|
||||
npm ci
|
||||
npm ci --no-optional
|
||||
FORCE_REDUCED_MOTION=true npm run build:e2e-test
|
||||
|
||||
- name: blocks.ini setup
|
||||
|
@ -140,7 +114,7 @@ jobs:
|
|||
|
||||
- name: Upload artifacts on failure
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: e2e-test-report
|
||||
path: reports/e2e
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
on:
|
||||
pull_request:
|
||||
types: [opened,synchronize,closed]
|
||||
push:
|
||||
issues:
|
||||
types: [edited]
|
||||
pull_request:
|
||||
types: [opened, synchronize, closed]
|
||||
push:
|
||||
issues:
|
||||
types: [edited]
|
||||
name: Project management automations
|
||||
jobs:
|
||||
project-management-automation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: trunk
|
||||
- uses: woocommerce/automations@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
automations: todos
|
||||
project-management-automation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: trunk
|
||||
- uses: woocommerce/automations@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
automations: todos
|
||||
|
|
|
@ -3,33 +3,33 @@ name: Release Pull Request Automation
|
|||
# Controls when the action will run. Triggers the workflow on create branch or tag
|
||||
# events but only acts on branch create.
|
||||
on:
|
||||
create:
|
||||
create:
|
||||
jobs:
|
||||
release-pull-request-automation:
|
||||
if: ${{ github.event.ref_type == 'branch' && contains( github.ref, 'release/' ) }}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: act10ns/slack@v1
|
||||
with:
|
||||
status: starting
|
||||
if: ${{ always() }}
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Create changeset for pull request
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
git commit -m 'Empty commit for release pull request' --allow-empty
|
||||
git push
|
||||
- name: Create Release Pull Request
|
||||
uses: woocommerce/automations@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
automations: release
|
||||
- uses: act10ns/slack@v1
|
||||
with:
|
||||
status: ${{ job.status }}
|
||||
steps: ${{ toJson(steps) }}
|
||||
if: ${{ always() }}
|
||||
release-pull-request-automation:
|
||||
if: ${{ github.event.ref_type == 'branch' && contains( github.ref, 'release/' ) }}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: act10ns/slack@v1
|
||||
with:
|
||||
status: starting
|
||||
if: ${{ always() }}
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Create changeset for pull request
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
git commit -m 'Empty commit for release pull request' --allow-empty
|
||||
git push
|
||||
- name: Create Release Pull Request
|
||||
uses: woocommerce/automations@v1
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
automations: release
|
||||
- uses: act10ns/slack@v1
|
||||
with:
|
||||
status: ${{ job.status }}
|
||||
steps: ${{ toJson(steps) }}
|
||||
if: ${{ always() }}
|
||||
|
|
|
@ -10,28 +10,15 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
name: Setup
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
|
||||
- name: Use Node.js 16.13.2
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.13.2
|
||||
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: Npm install and build
|
||||
run: |
|
||||
npm ci
|
||||
npm ci --no-optional
|
||||
FORCE_REDUCED_MOTION=true npm run build:e2e-test
|
||||
|
||||
- name: Get Composer Cache Directory
|
||||
|
@ -58,29 +45,19 @@ jobs:
|
|||
|
||||
PHPUnitTests:
|
||||
name: PHP Unit Tests
|
||||
needs: Setup
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
- name: Use Node.js 16.13.2
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.13.2
|
||||
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: Npm install #build is not needed
|
||||
run: |
|
||||
npm ci
|
||||
npm ci --no-optional
|
||||
- name: blocks.ini setup
|
||||
run: |
|
||||
echo 'woocommerce_blocks_phase = 3' > blocks.ini
|
||||
|
@ -100,32 +77,18 @@ jobs:
|
|||
JSUnitTests:
|
||||
name: JS Unit Tests
|
||||
needs: Setup
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node version and npm cache
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
|
||||
${{ runner.OS }}-build-${{ secrets.CACHE_VERSION }}-
|
||||
|
||||
- name: Use Node.js 16.13.2
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.13.2
|
||||
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
- name: Npm install and build
|
||||
run: |
|
||||
npm ci
|
||||
npm ci --no-optional
|
||||
FORCE_REDUCED_MOTION=true npm run build:e2e-test
|
||||
|
||||
- name: blocks.ini setup
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
name: Deploy to WordPress.org
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
release:
|
||||
types: [published]
|
||||
jobs:
|
||||
tag:
|
||||
name: New Release
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
steps:
|
||||
- uses: act10ns/slack@v1
|
||||
with:
|
||||
status: starting
|
||||
if: ${{ always() }}
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: WordPress Plugin Deploy
|
||||
id: deploy
|
||||
uses: 10up/action-wordpress-plugin-deploy@stable
|
||||
with:
|
||||
generate-zip: true
|
||||
tag:
|
||||
name: New Release
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
|
||||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
|
||||
SLUG: woo-gutenberg-products-block
|
||||
- name: Upload release asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: ${{github.workspace}}/woo-gutenberg-products-block.zip
|
||||
asset_name: woo-gutenberg-products-block.zip
|
||||
asset_content_type: application/zip
|
||||
- uses: act10ns/slack@v1
|
||||
with:
|
||||
status: ${{ job.status }}
|
||||
steps: ${{ toJson(steps) }}
|
||||
if: ${{ always() }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
steps:
|
||||
- uses: act10ns/slack@v1
|
||||
with:
|
||||
status: starting
|
||||
if: ${{ always() }}
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: WordPress Plugin Deploy
|
||||
id: deploy
|
||||
uses: 10up/action-wordpress-plugin-deploy@stable
|
||||
with:
|
||||
generate-zip: true
|
||||
env:
|
||||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
|
||||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
|
||||
SLUG: woo-gutenberg-products-block
|
||||
- name: Upload release asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: ${{github.workspace}}/woo-gutenberg-products-block.zip
|
||||
asset_name: woo-gutenberg-products-block.zip
|
||||
asset_content_type: application/zip
|
||||
- uses: act10ns/slack@v1
|
||||
with:
|
||||
status: ${{ job.status }}
|
||||
steps: ${{ toJson(steps) }}
|
||||
if: ${{ always() }}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -181,7 +181,6 @@
|
|||
"markdown-it": "12.3.2",
|
||||
"merge-config": "2.0.0",
|
||||
"mini-css-extract-plugin": "1.3.6",
|
||||
"ndb": "1.1.5",
|
||||
"patch-package": "6.4.7",
|
||||
"postcss": "8.2.13",
|
||||
"postcss-loader": "4.2.0",
|
||||
|
@ -234,6 +233,9 @@
|
|||
"react": "^17.0.0",
|
||||
"react-dom": "^17.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"ndb": "1.1.5"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
|
|
Loading…
Reference in New Issue