[pre-commit.ci] pre-commit autoupdate [norelease] #607
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
name: Test branch | |
on: [pull_request] | |
jobs: | |
test-client: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "npm" | |
cache-dependency-path: "./client/package-lock.json" | |
- run: cd client && npm ci | |
- run: make test-client | |
build-test-push: | |
runs-on: ubuntu-latest | |
env: | |
BRANCH_NAME: ${{ github.head_ref }} | |
CHROME_VERSION: "110.0" | |
SPLINTER_REMOTE_BROWSER_VERSION: "110.0" | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "npm" | |
cache-dependency-path: "./client/package-lock.json" | |
- run: cd client && npm ci && npm i @rollup/rollup-linux-x64-gnu && npm run build | |
- uses: pulumi/actions@v4 | |
- name: Generate sanitised branch name for Docker Image Tag | |
run: | | |
echo "SANITISED_BRANCH_NAME=$(echo $BRANCH_NAME | sed 's|/|-|g')" >> $GITHUB_ENV | |
- name: Set Docker Image Tag | |
run: | | |
echo "IMAGE_TAG=${{ vars.DOCKER_IMAGE }}:$SANITISED_BRANCH_NAME" >> $GITHUB_ENV | |
- id: stack | |
env: | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
run: | | |
outputs=$(pulumi stack output -j -s "development") | |
echo WIF_SERVICE_ACCOUNT=$(echo $outputs | jq -r '.service_account') >> "$GITHUB_OUTPUT" | |
echo WIF_PROVIDER=$(echo $outputs | jq -r '.workload_identity_provider') >> "$GITHUB_OUTPUT" | |
- uses: google-github-actions/auth@v1 | |
id: auth | |
with: | |
token_format: access_token | |
workload_identity_provider: ${{ steps.stack.outputs.WIF_PROVIDER }} | |
service_account: ${{ steps.stack.outputs.WIF_SERVICE_ACCOUNT }} | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
with: | |
registry: gcr.io | |
username: oauth2accesstoken | |
password: ${{ steps.auth.outputs.access_token }} | |
- uses: docker/build-push-action@v4 | |
name: Build image | |
with: | |
load: true | |
tags: ${{ env.IMAGE_TAG }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- run: docker pull selenoid/chrome:${{ env.CHROME_VERSION }} | |
- run: make test-end-to-end-docker | |
name: Run tests | |
env: | |
DOCKER_IMAGE: ${{ env.IMAGE_TAG }} | |
- uses: docker/build-push-action@v4 | |
name: Push image | |
with: | |
push: true | |
tags: ${{ env.IMAGE_TAG }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |