diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e7a755..d8cf905 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,23 +6,12 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: laravel-runner-php84 steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: '24' - - - name: Set up PHP with Composer - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - tools: composer:v2 - - name: Install PHP dependencies run: composer install --no-interaction --prefer-dist --optimize-autoloader @@ -31,6 +20,9 @@ jobs: npm ci npm run build + - name: Remove docs folder + run: rm -rf docs + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -48,5 +40,5 @@ jobs: file: ${{ github.workspace }}/Dockerfile push: true tags: | - gitgud.foo/thegrind/flowtodo:latest - gitgud.foo/thegrind/flowtodo:${{ github.event.release.tag_name }} \ No newline at end of file + gitgud.foo/thegrind/authentikate:latest + gitgud.foo/thegrind/authentikate:${{ github.event.release.tag_name }} \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..7754a77 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,41 @@ +name: linter + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + +permissions: + contents: write + +jobs: + quality: + runs-on: laravel-runner-php84 + environment: Testing + steps: + - uses: actions/checkout@v4 + + - name: Add Flux Credentials Loaded From ENV + run: composer config http-basic.composer.fluxui.dev "${{ secrets.FLUX_USERNAME }}" "${{ secrets.FLUX_LICENSE_KEY }}" + + - name: Install Dependencies + run: | + composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + npm install + + - name: Run Pint + run: vendor/bin/pint + + # - name: Commit Changes + # uses: stefanzweifel/git-auto-commit-action@v5 + # with: + # commit_message: fix code style + # commit_options: '--no-verify' + # file_pattern: | + # **/* + # !.github/workflows/* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..67e0f73 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,59 @@ +name: tests + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + +jobs: + ci: + runs-on: laravel-runner-php84 + environment: Testing + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node Dependencies + run: npm i + + - name: Add Flux Credentials Loaded From ENV + run: composer config http-basic.composer.fluxui.dev "${{ secrets.FLUX_USERNAME }}" "${{ secrets.FLUX_LICENSE_KEY }}" + + - name: Install Dependencies + run: composer install --no-interaction --prefer-dist --optimize-autoloader + + - name: Copy Environment File + run: cp .env.example .env + + - name: Generate Application Key + run: php artisan key:generate + + - name: Build Assets + run: npm run build + + - name: Setup Test RSA Keys + run: | + echo "Setting up test RSA keys..." + mkdir -p storage/testing/oauth + php artisan app:generate-keys --path="storage/testing/oauth" + echo "✅ Test keys generated" + + - name: Run Tests + run: ./vendor/bin/pest + + - name: Cleanup Test Keys + if: always() + run: | + echo "Cleaning up test RSA keys..." + if [ -d "storage/testing" ]; then + rm -rf storage/testing + echo "✅ Test storage directory cleaned up" + else + echo "â„šī¸ No test storage directory found to clean up" + fi \ No newline at end of file