diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 736906d..4632b65 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -25,6 +25,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Check playwright versions match + run: ./test/versions-match.sh + - name: Test Docker Image run: | docker build . --file Dockerfile -t $IMAGE_NAME --cache-from ghcr.io/mt-ag/$IMAGE_NAME diff --git a/files/package.json b/files/package.json index a5b3cf6..b926bb0 100644 --- a/files/package.json +++ b/files/package.json @@ -1,7 +1,7 @@ { "license": "MIT", "dependencies": { - "@playwright/test": "1.30.0" + "@playwright/test": "1.36.2" }, "scripts": {} } diff --git a/test/versions-match.sh b/test/versions-match.sh new file mode 100755 index 0000000..18459ac --- /dev/null +++ b/test/versions-match.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Path to your Dockerfile and package.json +DOCKERFILE_PATH="./Dockerfile" +PACKAGE_JSON_PATH="./files/package.json" + +# Extract version from Dockerfile +DOCKERFILE_VERSION=$(grep '^FROM' $DOCKERFILE_PATH | awk -F':' '{print $2}' | sed 's/-focal//' | sed 's/v//') + +# Extract version from package.json +PACKAGE_JSON_VERSION=$(awk -F'"' '/@playwright\/test/ {print $4}' $PACKAGE_JSON_PATH) + +# Compare versions +if [ "$DOCKERFILE_VERSION" = "$PACKAGE_JSON_VERSION" ]; then + echo "Versions match: $DOCKERFILE_VERSION" +else + echo "Versions do not match. Dockerfile version: $DOCKERFILE_VERSION, package.json version: $PACKAGE_JSON_VERSION" +fi