Skip to content

Commit

Permalink
als upgrade package.json version + added test
Browse files Browse the repository at this point in the history
  • Loading branch information
phartenfeller committed Jul 28, 2023
1 parent 5b0c385 commit 96ef191
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion files/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"license": "MIT",
"dependencies": {
"@playwright/test": "1.30.0"
"@playwright/test": "1.36.2"
},
"scripts": {}
}
18 changes: 18 additions & 0 deletions test/versions-match.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 96ef191

Please sign in to comment.