chore(deps): update test packages to v2.1.8 #4254
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
pull_request: | |
types: [synchronize, opened, reopened] | |
name: e2e | |
jobs: | |
build-and-release: | |
name: Build and Release | |
runs-on: ubuntu-latest | |
outputs: | |
npm-package-version: ${{ steps.version.outputs.npm-package-version }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set NPM Env | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Choose version | |
id: version | |
run: 'node tasks/set-npm-canary-version.js' | |
- name: Build | |
run: npm run build | |
- name: Lerna publish canary version | |
run: | | |
git config --global user.name "stryker-mutator[bot]" | |
git config --global user.email 158062761+stryker-mutator[bot]@users.noreply.github.com | |
npx lerna version ${{ steps.version.outputs.npm-package-version }} --no-git-tag-version --no-push --exact --force-publish --yes --no-conventional-commits | |
git commit -am "temp-commit" | |
npx lerna publish from-package --dist-tag canary --no-git-reset --yes --no-verify-access | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/stryker-mutator/dashboard | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}},value=v${{ steps.version.outputs.npm-package-version }} | |
# Add a sleep to give npmjs.com the time to get the versions consistent | |
- run: sleep 15s | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
id: build | |
with: | |
context: ./docker | |
push: true | |
build-args: 'version=${{ steps.meta.outputs.version }}' | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
annotations: ${{ steps.meta.outputs.annotations }} | |
platforms: linux/amd64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
deploy-and-test: | |
name: Deploy to Acceptance and run E2E tests | |
needs: build-and-release | |
runs-on: ubuntu-latest | |
environment: | |
name: Acceptance | |
url: https://stryker-dashboard-acceptance.azurewebsites.net/ | |
concurrency: | |
group: Acceptance | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download & install badge-api package | |
run: ./tasks/download-badge-api-package.sh ${{ needs.build-and-release.outputs.npm-package-version }} | |
- uses: azure/login@v2 | |
name: Azure login | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS_ACCEPTANCE }} | |
- name: 'Deploy stryker-dashboard-acceptance.azurewebsites.net' | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: 'stryker-dashboard-acceptance' | |
images: 'ghcr.io/stryker-mutator/dashboard:${{ needs.build-and-release.outputs.npm-package-version }}' | |
- name: 'Deploy stryker-mutator-badge-api-acceptance.azurewebsites.net' | |
uses: Azure/functions-action@v1 | |
id: fa | |
with: | |
app-name: stryker-mutator-badge-api-acceptance | |
package: 'package' | |
- name: 'Verify deployment' | |
run: | | |
node tasks/check-version badge-api https://stryker-mutator-badge-api-acceptance.azurewebsites.net/api ${{ needs.build-and-release.outputs.npm-package-version }} | |
node tasks/check-version dashboard https://stryker-dashboard-acceptance.azurewebsites.net/api/version ${{ needs.build-and-release.outputs.npm-package-version }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Install browsers | |
run: | | |
cd packages/e2e | |
npx playwright install chromium --with-deps | |
- name: Build | |
run: | | |
cd packages/e2e | |
npx tsc -b | |
cd ../.. | |
- name: Run e2e tests | |
run: | | |
cd packages/e2e | |
npm run test | |
env: | |
BASE_URL: https://stryker-dashboard-acceptance.azurewebsites.net | |
E2E_AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.E2E_AZURE_STORAGE_CONNECTION_STRING }} | |
E2E_JWT_SECRET: ${{ secrets.E2E_JWT_SECRET }} | |
E2E_ACCESS_TOKEN: ${{ secrets.E2E_ACCESS_TOKEN }} | |
E2E_BADGE_API_BASE_URL: https://stryker-mutator-badge-api-acceptance.azurewebsites.net | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: playwright-videos | |
path: | | |
packages/e2e/test-results/ | |
packages/e2e/playwright-report/ |