diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index 3b87f957..e83db07f 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -2,11 +2,8 @@ name: Lighthouse Compare Action on: pull_request: -env: - # Subpaths to investigate - SUBPATHS: "/games,/games/series,/games/dlcs,/planning,/backlog,/tests,/stats,/links" - jobs: + getPreviewUrl: runs-on: ubuntu-latest outputs: @@ -39,28 +36,39 @@ jobs: - name: Print URL run: echo "${{ steps.add_prefix.outputs.full_url }}" - lighthouse_mobile: + constructUrls: needs: getPreviewUrl runs-on: ubuntu-latest - permissions: - actions: write - contents: write - pull-requests: write - issues: write + env: + # Subpaths to investigate + SUBPATHS: "/games,/games/series,/games/dlcs,/planning,/backlog,/tests,/stats,/links" + outputs: + url_list: ${{ steps.construct_url_list.outputs.url_list }} steps: - uses: actions/checkout@v4 - - run: mkdir -p ${{ github.workspace }}/tmp/artifacts - name: Construct URLs - id: construct_urls + id: construct_url_list run: | URL_LIST=$(echo "${{ env.SUBPATHS }}" | tr ',' '\n' | sed "s|^|${{ needs.getPreviewUrl.outputs.preview_url }}|g" | tr '\n' ',' | sed 's|,$||') echo "url_list=$URL_LIST" >> $GITHUB_OUTPUT - name: Debug URLs run: | - echo "Constructed URLs: ${{ steps.construct_urls.outputs.url_list }}" + echo "Constructed URLs: ${{ steps.construct_url_list.outputs.url_list }}" + + lighthouse_mobile: + needs: constructUrls + runs-on: ubuntu-latest + permissions: + actions: write + contents: write + pull-requests: write + issues: write + steps: + - uses: actions/checkout@v4 + - run: mkdir -p ${{ github.workspace }}/tmp/artifacts - uses: foo-software/lighthouse-check-action@master with: - urls: ${{ steps.construct_urls.outputs.url_list }} + urls: ${{ needs.constructUrls.outputs.url_list }} device: mobile prCommentEnabled: true gitHubAccessToken: ${{ secrets.GITHUB_TOKEN }} @@ -73,7 +81,7 @@ jobs: retention-days: 1 lighthouse_desktop: - needs: getPreviewUrl + needs: constructUrls runs-on: ubuntu-latest permissions: actions: write @@ -83,17 +91,9 @@ jobs: steps: - uses: actions/checkout@v4 - run: mkdir -p ${{ github.workspace }}/tmp/artifacts - - name: Construct URLs - id: construct_urls - run: | - URL_LIST=$(echo "${{ env.SUBPATHS }}" | tr ',' '\n' | sed "s|^|${{ needs.getPreviewUrl.outputs.preview_url }}|g" | tr '\n' ',' | sed 's|,$||') - echo "url_list=$URL_LIST" >> $GITHUB_OUTPUT - - name: Debug URLs - run: | - echo "Constructed URLs: ${{ steps.construct_urls.outputs.url_list }}" - uses: foo-software/lighthouse-check-action@master with: - urls: ${{ steps.construct_urls.outputs.url_list }} + urls: ${{ needs.constructUrls.outputs.url_list }} device: desktop prCommentEnabled: true gitHubAccessToken: ${{ secrets.GITHUB_TOKEN }}