Skip to content

Commit

Permalink
chore: Add test workflow on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
7nohe committed May 19, 2024
1 parent 6bbebed commit 0fa794e
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9
- name: install node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: install dependencies
run: pnpm install --frozen-lockfile

- run: cp .env.example .env
working-directory: examples/laravel10-app

- name: composer install
run: docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/var/www/html" -w /var/www/html laravelsail/php81-composer:latest composer install --ignore-platform-reqs
working-directory: examples/laravel10-app

- name: start database
run: ./vendor/bin/sail up -d mysql
working-directory: examples/laravel10-app

- name: start laravel
run: ./vendor/bin/sail up -d
working-directory: examples/laravel10-app

- name: generate key
run: ./vendor/bin/sail artisan key:generate
working-directory: examples/laravel10-app

- name: migrate
run: ./vendor/bin/sail artisan migrate
working-directory: examples/laravel10-app

- name: npm install
run: ./vendor/bin/sail npm install
working-directory: examples/laravel10-app

- name: generate types
run: sh debug.sh

- name: archive generated files
uses: actions/upload-artifact@v4
with:
name: generated-file-${{ matrix.os }}
path: examples/laravel10-app/resources/js/types

0 comments on commit 0fa794e

Please sign in to comment.