Skip to content

Commit 890047f

Browse files
committed
Update maven version in Github actions
1 parent b35bf54 commit 890047f

File tree

2 files changed

+95
-6
lines changed

2 files changed

+95
-6
lines changed

.github/workflows/playwright-tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ name: Playwright Tests
44
on:
55
push:
66
branches:
7-
- '**' # Run on every branch for every commit
7+
- '**'
88
pull_request:
99
branches:
10-
- '**' # Run on every pull request for any branch
10+
- '**'
1111

1212
jobs:
1313
test:
@@ -18,7 +18,7 @@ jobs:
1818
- name: Checkout repository
1919
uses: actions/checkout@v3
2020

21-
# Step 2: Set up JDK 17 (adjust if you're using a different version)
21+
# Step 2: Set up JDK 17
2222
- name: Set up JDK 17
2323
uses: actions/setup-java@v3
2424
with:
@@ -31,13 +31,13 @@ jobs:
3131
wget https://downloads.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
3232
tar -xvzf apache-maven-3.9.9-bin.tar.gz
3333
sudo mv apache-maven-3.9.9 /opt/maven
34-
sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn
34+
echo "export PATH=/opt/maven/bin:$PATH" >> $GITHUB_ENV
3535
3636
# Step 4: Verify Maven installation
3737
- name: Verify Maven version
3838
run: mvn --version
3939

40-
# Step 5: Cache Maven dependencies to speed up future builds
40+
# Step 5: Cache Maven dependencies
4141
- name: Cache Maven dependencies
4242
uses: actions/cache@v3
4343
with:
@@ -48,4 +48,4 @@ jobs:
4848
4949
# Step 6: Run Maven to execute Playwright tests
5050
- name: Run Playwright Tests
51-
run: mvn verify
51+
run: mvn verify

update-all-branches.sh

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/bin/bash
2+
3+
# Check if commit hash is provided as an argument
4+
if [ -z "$1" ]; then
5+
echo "Usage: $0 <commit-hash>"
6+
exit 1
7+
fi
8+
9+
# Commit to cherry-pick (from the command-line argument)
10+
COMMIT_HASH="$1"
11+
12+
# List of branches
13+
BRANCHES=(
14+
"sample-code/end-to-end"
15+
"sample-code/module-10-assertions"
16+
"sample-code/module-11-waits"
17+
"sample-code/module-12-mocking-api-calls"
18+
"sample-code/module-12-api-interactions "
19+
"sample-code/module-13-page-objects"
20+
"sample-code/module-14-allure-reporting"
21+
"sample-code/module-14-organizing-your-tests"
22+
"sample-code/module-14-parallel-execution"
23+
"sample-code/module-15-parallel-execution"
24+
"sample-code/module-16-allure-reporting"
25+
"sample-code/module-17-cucumber"
26+
"sample-code/module-3-my-first-playwright-test"
27+
"sample-code/module-4-interacting-with-elements"
28+
"sample-code/module-5-refactoring"
29+
"sample-code/module-6-browser-options"
30+
"sample-code/module-7-browser-contexts"
31+
"sample-code/module-8-locators"
32+
"sample-code/module-9-forms"
33+
"sample-code/start-here"
34+
)
35+
36+
# Iterate over each branch
37+
for BRANCH in "${BRANCHES[@]}"; do
38+
echo "Processing branch: $BRANCH"
39+
40+
# Checkout the branch
41+
git checkout "$BRANCH"
42+
if [ $? -ne 0 ]; then
43+
echo "Failed to checkout branch: $BRANCH"
44+
continue
45+
fi
46+
47+
# Cherry-pick the commit
48+
git cherry-pick "$COMMIT_HASH"
49+
if [ $? -ne 0 ]; then
50+
echo "Merge conflict detected on branch: $BRANCH"
51+
echo "Please resolve the conflict, commit the changes, and type 'continue' to proceed, or 'abort' to skip this branch."
52+
53+
while true; do
54+
read -p "Type 'continue' to proceed or 'abort' to skip this branch: " RESPONSE
55+
case $RESPONSE in
56+
continue)
57+
echo "Continuing after resolving the conflict..."
58+
break
59+
;;
60+
abort)
61+
echo "Aborting cherry-pick on branch: $BRANCH"
62+
git cherry-pick --abort
63+
continue 2
64+
;;
65+
*)
66+
echo "Invalid input. Please type 'continue' or 'abort'."
67+
;;
68+
esac
69+
done
70+
fi
71+
72+
# Commit the changes if no conflict or resolved
73+
git commit --allow-empty -m "Cherry-pick commit $COMMIT_HASH to update branch $BRANCH"
74+
if [ $? -ne 0 ]; then
75+
echo "Failed to commit changes on branch: $BRANCH"
76+
continue
77+
fi
78+
79+
# Push the changes to origin
80+
git push origin "$BRANCH"
81+
if [ $? -ne 0 ]; then
82+
echo "Failed to push branch: $BRANCH"
83+
continue
84+
fi
85+
86+
echo "Successfully processed branch: $BRANCH"
87+
done
88+
89+
echo "All branches processed."

0 commit comments

Comments
 (0)