Merge pull request #64 from dreamsicle-io/release/4.2.2-RC5 #3
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: Test | |
on: | |
push: | |
branches: [master] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. | |
- name: Checkout Repo | |
id: checkout_repo | |
uses: actions/checkout@v4 | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. | |
- name: Enter Theme Directory | |
id: enter_theme_directory | |
run: cd package | |
# Gets the name from package.json and sets it as an environment variable. | |
- name: Set Theme Name | |
id: set_theme_name | |
run: echo "THEME_NAME=$(jq -r '.name' package.json)" >> $GITHUB_ENV | |
# Gets the version from package.json and sets it as an environment variable. | |
- name: Set Theme Version | |
id: set_theme_version | |
run: echo "THEME_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV | |
# Gets the PHP version from composer.json and sets it as an environment variable. | |
- name: Set PHP Version | |
id: set_php_version | |
run: echo "PHP_VERSION=$(jq -r '.require.php' composer.json)" >> $GITHUB_ENV | |
# Gets the Node version from .nvmrc and sets it as an environment variable. | |
- name: Set Node Version | |
id: set_node_version | |
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV | |
# Setup PHP. | |
- name: Setup PHP | |
id: setup_php | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
# Setup Node. | |
- name: Setup Node | |
id: setup_node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
# Installs npm and composer dependencies. Note that we use `npm install` | |
# instead of `npm ci` because we do not yet have a lock file. | |
- name: Install | |
id: install | |
run: npm install | |
# Lint all files. | |
- name: Lint | |
id: lint | |
run: npm run lint | |
# Runs a build. | |
- name: Build | |
id: build | |
run: npm run build | |
# Return to root. | |
- name: Return to Root Directory | |
id: return_to_root_directory | |
run: cd .. |