diff --git a/.github/workflows/check-app-quality.yml b/.github/workflows/check-app-quality.yml new file mode 100644 index 0000000..a0d7c46 --- /dev/null +++ b/.github/workflows/check-app-quality.yml @@ -0,0 +1,51 @@ +name: Check App Quality + +on: + pull_request: + branches: [main] + +jobs: + preview: + name: Create deploy preview + runs-on: ubuntu-latest + outputs: + deploy-url: ${{ steps.netlify.outputs.deploy-url }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + cache: npm + - name: Install dependencies + run: npm ci + - name: Run Astro build command + run: npm run build + - name: Deploy to Netlify + id: netlify + uses: nwtgck/actions-netlify@v2 + with: + publish-dir: dist + production-branch: main + github-token: ${{ secrets.GITHUB_TOKEN }} + alias: deploy-preview-${{ github.event.number }} + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 1 + + lighthouse: + name: Run Lighthouse tests + needs: preview + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Lighthouse + uses: foo-software/lighthouse-check-action@master + with: + urls: ${{ needs.preview.outputs.deploy-url }} + gitAuthor: ${{ github.actor }} + gitBranch: ${{ github.ref }} + gitHubAccessToken: ${{ secrets.GITHUB_TOKEN }} + device: all + prCommentEnabled: true + prCommentSaveOld: false diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index aad4494..5f35be4 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - cache: 'npm' + cache: npm - name: Install dependencies run: npm ci - name: Run Prettier @@ -29,22 +29,8 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 - cache: 'npm' + cache: npm - name: Install dependencies run: npm ci - name: Run TypeScript types check run: npm run ts:check - - build: - name: Build project - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: 'npm' - - name: Install dependencies - run: npm ci - - name: Run Astro build command - run: npm run build