Merge pull request #101 from h3ravel/snyk-fix-677dbb95e11b334a5c2c6fd… #218
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: Run Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| check: | |
| name: Run Available Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| # https://github.community/t5/GitHub-Actions/github-actions-cannot-connect-to-mysql-service/td-p/30611# | |
| mysql: | |
| image: mysql:5.7 | |
| env: | |
| MYSQL_ROOT_PASSWORD: password | |
| MYSQL_DATABASE: h3ravel_test | |
| ports: | |
| - 3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - name: Install dependencies (skip postinstall) | |
| run: | | |
| pnpm install --ignore-scripts --no-frozen-lockfile | |
| - name: Build Packages | |
| run: | | |
| pnpm build | |
| NODE_ENV=production DIST_DIR=dist pnpm -r --workspace-concurrency=1 --filter './examples/*' run build | |
| - name: Run musket postinstall | |
| run: | | |
| pnpm -r --workspace-concurrency=1 --filter './examples/*' run postinstall | |
| - name: Run tests and generate code coverage | |
| run: pnpm coverage | |
| - name: Upload coverage reports to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: h3ravel/framework | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: true |