test: add Options classes tests and fix Arr::set return value bug #18
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: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| SLIC_BIN: ${{ github.workspace }}/slic/slic | |
| jobs: | |
| phpcs: | |
| name: PHPCS | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| tools: composer | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Run PHPCS | |
| run: vendor/bin/phpcs | |
| tests-php: | |
| name: PHP Tests (PHP ${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [ '8.0', '8.1', '8.2', '8.3' ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout slic | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: stellarwp/slic | |
| ref: main | |
| path: slic | |
| fetch-depth: 1 | |
| - name: Start ssh-agent | |
| run: | | |
| mkdir -p "${HOME}/.ssh" | |
| ssh-agent -a /tmp/ssh_agent.sock | |
| - name: Export SSH_AUTH_SOCK | |
| run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV | |
| - name: Set up slic env vars | |
| run: | | |
| echo "SLIC_WP_DIR=${GITHUB_WORKSPACE}/slic/_wordpress" >> $GITHUB_ENV | |
| echo "SLIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV | |
| - name: Set run context | |
| run: echo "SLIC=1" >> $GITHUB_ENV && echo "CI=1" >> $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: Set up plugin | |
| run: | | |
| ${SLIC_BIN} use workos | |
| ${SLIC_BIN} composer install | |
| - name: Run wpunit tests | |
| run: ${SLIC_BIN} run wpunit --ext DotReporter | |
| js-build: | |
| name: JS Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Verify build | |
| run: echo "No JS build step configured yet." |