Skip to content

Commit

Permalink
refactor: (WIP) explicitly versioning reports
Browse files Browse the repository at this point in the history
  • Loading branch information
uchilaka committed Apr 2, 2024
1 parent e6d82d0 commit f50f6e8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
# - name: Get installed Playwright version
# id: playwright-version
# run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').devDependencies['@playwright/test'].version)")" >> $GITHUB_ENV

# See https://dev.to/ayomiku222/how-to-cache-playwright-browser-on-github-actions-51o6
- name: Cache playwright binaries
Expand All @@ -39,7 +45,7 @@ jobs:
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
key: ${{ runner.os }}-playwright-${{ env.COMMIT_SHORT_SHA }}

- name: Install dependencies
run: npm ci
Expand All @@ -56,7 +62,7 @@ jobs:
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
name: playwright-report-nodejs-v${{ matrix.node-version }}
path: playwright-report/nodejs-v${{ matrix.node-version }}
retention-days: 15
overwrite: true

0 comments on commit f50f6e8

Please sign in to comment.