Feat/repo set up #21
Workflow file for this run
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: 'Tests' | |
| on: | |
| pull_request: | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| suite: | |
| - wpunit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v4 | |
| # ------------------------------------------------------------------------------ | |
| # Set up PHP to run slic | |
| # ------------------------------------------------------------------------------ | |
| - name: Configure PHP environment | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 7.4 | |
| # ------------------------------------------------------------------------------ | |
| # Checkout slic | |
| # ------------------------------------------------------------------------------ | |
| - name: Checkout slic | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: stellarwp/slic | |
| ref: main | |
| path: slic | |
| fetch-depth: 1 | |
| # ------------------------------------------------------------------------------ | |
| # Prepare our composer cache directory | |
| # ------------------------------------------------------------------------------ | |
| - name: Get Composer Cache Directory | |
| id: get-composer-cache-dir | |
| run: | | |
| echo "::set-output name=dir::$(composer config cache-files-dir)" | |
| - uses: actions/cache@v4 | |
| id: composer-cache | |
| with: | |
| path: ${{ steps.get-composer-cache-dir.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| # ------------------------------------------------------------------------------ | |
| # Initialize slic | |
| # ------------------------------------------------------------------------------ | |
| - name: Set up slic env vars | |
| run: | | |
| echo "SLIC_BIN=${GITHUB_WORKSPACE}/slic/slic" >> $GITHUB_ENV | |
| echo "SLIC_WP_DIR=${GITHUB_WORKSPACE}/slic/_wordpress" >> $GITHUB_ENV | |
| echo "SLIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV | |
| - name: Set run context for slic | |
| run: echo "SLIC=1" >> $GITHUB_ENV && echo "CI=1" >> $GITHUB_ENV | |
| - name: Start ssh-agent | |
| run: | | |
| mkdir -p "${HOME}/.ssh"; | |
| ssh-agent -a /tmp/ssh_agent.sock; | |
| - name: Export SSH_AUTH_SOCK env var | |
| run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV | |
| - name: Set up slic for CI | |
| run: | | |
| cd ${GITHUB_WORKSPACE}/.. | |
| ${SLIC_BIN} here | |
| ${SLIC_BIN} interactive off | |
| ${SLIC_BIN} build-prompt off | |
| ${SLIC_BIN} build-subdir off | |
| ${SLIC_BIN} xdebug off | |
| ${SLIC_BIN} debug on | |
| ${SLIC_BIN} info | |
| ${SLIC_BIN} config | |
| - name: Start the Chrome container | |
| run: ${SLIC_BIN} up chrome | |
| - name: Set up StellarWP Schema Models | |
| run: | | |
| ${SLIC_BIN} use schema-models | |
| ${SLIC_BIN} composer install | |
| - name: Init the WordPress container | |
| run: | | |
| ${SLIC_BIN} up wordpress | |
| ${SLIC_BIN} wp core version | |
| ${SLIC_BIN} wp core update --force --version=6.7 | |
| ${SLIC_BIN} wp core version | |
| - name: Ensure Kadence is installed | |
| run: | | |
| ${SLIC_BIN} wp theme install kadence --activate | |
| - name: Run suites | |
| run: ${SLIC_BIN} run ${{ matrix.suite }} --ext DotReporter |