Skip to content

Commit

Permalink
Added github actions for each branch
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Jan 3, 2025
1 parent 659649e commit d10688f
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 1 deletion.
127 changes: 127 additions & 0 deletions .github/workflows/nightly-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Nightly Builds

on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allows manual triggering of the workflow

jobs:
build-main:
name: Main
uses: ./.github/workflows/setup-and-test.yml
with:
branch: main

build-todomvc:
name: TodoMVC Solution
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/todomvc-solution

build-lesson-1:
name: Lesson 1 Your First Serenity BDD Test Case
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-1-your-first-serenity-bdd-test-case

build-lesson-2:
name: Lesson 2 Serenity BDD Step Methods
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-2-serenity-bdd-step-methods

build-lesson-3:
name: Lesson 3 Steps with Parameters
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-3-steps-with-parameters

build-lesson-5:
name: Lesson 5 Locating Elements
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-5-locating-elements

build-lesson-6:
name: Lesson 6 Action Classes
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-6-action-classes

build-lesson-8:
name: Lesson 8 Page Objects
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-8-page-objects

build-lesson-9:
name: Lesson 9 FindBy Annotation
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-9-findby-annotation

build-lesson-10:
name: Lesson 10 Page Objects Without FindBys
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-10-page-objects-without-findbys

build-lesson-11:
name: Lesson 11 Working with Form Fields
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-11-working-with-form-fields

build-lesson-12:
name: Lesson 12 Working with Checkboxes
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-12-working-with-checkboxes

build-lesson-13:
name: Lesson 13 Dropdowns
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-13-dropdowns

build-lesson-14:
name: Lesson 14 Contact Form
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-14-contact-form

build-lesson-15:
name: Lesson 15 Mouse Interactions
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-15-mouse-interactions

build-lesson-16:
name: Lesson 16 URL Configuration
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-16-url-configuration

build-lesson-17:
name: Lesson 17 Implicit Waits
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-17-implicit-waits

build-lesson-18:
name: Lesson 18 Explicit Waits
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-18-explicit-waits

build-lesson-19:
name: Lesson 19 Chrome Configuration
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-19-chrome-configuration

build-lesson-20:
name: Lesson 20 Environments
uses: ./.github/workflows/setup-and-test.yml
with:
branch: sample-code/lesson-20-environments
47 changes: 47 additions & 0 deletions .github/workflows/setup-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Common Setup

on:
workflow_call:
inputs:
branch:
required: true
type: string

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
# Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'

# Install Maven 3.9.9
- name: Setup Maven Action
uses: s4u/setup-maven-action@v1.7.0
with:
checkout-fetch-depth: 0
java-version: 17
java-distribution: temurin
maven-version: 3.9.9

# Verify Maven installation
- name: Verify Maven version
run: mvn --version

# Checkout the specified branch
- name: Checkout branch ${{ inputs.branch }}
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
fetch-depth: 0
clean: true

# Run the test suite
- name: Run Tests
run: |
echo "Running tests for branch ${{ inputs.branch }}"
mvn clean verify
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@
</plugin>
</plugins>
</build>
</project>-
</project>

0 comments on commit d10688f

Please sign in to comment.