Added support for composer create-project #110
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: Test Scaffold | |
# Workflow to **validate** the **integrity** of the scaffold template itself. | |
on: | |
push: | |
branches: | |
- 1.x | |
pull_request: | |
branches: | |
- 1.x | |
- 'feature/**' | |
jobs: | |
scaffold-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Upgrade sqlite3 | |
run: | | |
wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz -O /tmp/sqlite.tar.gz | |
tar -xzf /tmp/sqlite.tar.gz -C /tmp | |
cd /tmp/sqlite-autoconf-3450300 | |
./configure CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" --prefix=/usr/local | |
make && sudo make install | |
sudo ldconfig | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
extensions: gd, sqlite, pdo_sqlite | |
- name: Check coding standards | |
uses: luizm/action-sh-checker@v0.8.0 | |
env: | |
SHFMT_OPTS: -i 2 -ci -s -d | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
- name: Install Ahoy | |
run: | | |
os=$(uname -s | tr '[:upper:]' '[:lower:]') && architecture=$(case $(uname -m) in x86_64 | amd64) echo "amd64" ;; aarch64 | arm64 | armv8) echo "arm64" ;; *) echo "amd64" ;; esac) | |
sudo wget -q https://github.com/ahoy-cli/ahoy/releases/download/v2.1.1/ahoy-bin-"${os}-${architecture}" -O /usr/local/bin/ahoy | |
sudo chown "$USER" /usr/local/bin/ahoy && chmod +x /usr/local/bin/ahoy | |
- name: Install dependencies | |
run: composer install | |
- name: Run tests | |
run: | | |
composer run lint | |
export XDEBUG_MODE='coverage' && composer run test | |
- name: Upload coverage report as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{github.job}}-code-coverage-report | |
path: ./.scaffold/.coverage-html | |
if-no-files-found: error | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4 | |
if: ${{ env.CODECOV_TOKEN != '' }} | |
with: | |
directory: ./.scaffold/.coverage-html | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
scaffold-test-actions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check coding standards with yamllint | |
run: yamllint --config-file .scaffold/tests/.yamllint-for-gha.yml .github/workflows | |
continue-on-error: ${{ vars.DREVOPS_CI_YAMLLINT_IGNORE_FAILURE == '1' }} | |
- name: Check coding standards with actionlint | |
run: docker run --rm -v "${GITHUB_WORKSPACE:-.}":/app --workdir /app rhysd/actionlint:1.6.27 -ignore 'SC2002:' -ignore 'SC2155:' | |
continue-on-error: ${{ vars.DREVOPS_CI_ACTIONLINT_IGNORE_FAILURE == '1' }} | |
scaffold-test-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
- name: Install dependencies | |
run: npm install | |
working-directory: '${{ github.workspace }}/.scaffold/docs' | |
- name: Build documentation site | |
run: npm run build | |
working-directory: '${{ github.workspace }}/.scaffold/docs' | |
- name: Run tests | |
run: npm run test | |
working-directory: '${{ github.workspace }}/.scaffold/docs' | |
- name: Deploy to Netlify | |
uses: nwtgck/actions-netlify@v3.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
publish-dir: '.scaffold/docs/build' | |
production-branch: 1.x | |
deploy-message: "Deploy from GitHub Actions" | |
enable-pull-request-comment: true | |
enable-commit-comment: true | |
overwrites-pull-request-comment: true | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
timeout-minutes: 1 |