aperta-principium/Interclip

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: Continuous integration
on:
  push:
  pull_request:
    branches: [main]
    types: [opened]

jobs:
  ci:
    runs-on: ${{ matrix.operating-system }}

    strategy:
      matrix:
        operating-system: [ubuntu-latest, macos-latest]
        php-versions: ["8.1"]

    name: ๐Ÿ“ฆ php ${{ matrix.php-versions }} ๐Ÿ–ฅ๏ธ ${{ matrix.operating-system }}

    steps:
      - name: ๐Ÿ›’ Checkout repo
        uses: actions/checkout@v4

      - name: ๐Ÿ˜ Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-versions }}
          tools: composer:v2

      - name: ๐Ÿฏ Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: 16

      - name: โœ… Validate Composer files
        run: composer validate

      - name: ๐Ÿ“‚ Cache Composer packages
        uses: actions/cache@v3
        with:
          path: vendor
          key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
          restore-keys: |
            ${{ runner.os }}-php-

      - name: ๐ŸŽน Install Dependencies
        run: |
          composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
          yarn

      - name: ๐Ÿ—๏ธ Build
        run: yarn build

      - name: ๐Ÿงช Run tests
        run: ./vendor/bin/pest