From 0fa794ebffd28c907c27b5662c7ae8690c031cbf Mon Sep 17 00:00:00 2001 From: Urata Daiki <7nohe@users.noreply.github.com> Date: Sun, 19 May 2024 21:57:51 +0900 Subject: [PATCH] chore: Add test workflow on CI --- .github/workflows/test.yml | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ec39b87 --- /dev/null +++ b/.github/workflows/test.yml @@ -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