Skip to content

Commit

Permalink
Adds GitHub actions for main and staging branches
Browse files Browse the repository at this point in the history
  • Loading branch information
joaobispo committed Aug 2, 2024
1 parent 8069839 commit 8f4401f
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
checks: write

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
path: workspace/alpakka

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

- name: Check out specs-java-libs repo
uses: actions/checkout@v4
with:
repository: specs-feup/specs-java-libs
path: workspace/specs-java-libs

- name: Check out lara-framework repo
uses: actions/checkout@v4
with:
repository: specs-feup/lara-framework
ref: master
path: workspace/lara-framework

# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

# Setting up gradle multi-project would be helpful
- name: Build and Test AnyWeaver
working-directory: workspace/anyweaver/AnyWeaver
run: ./gradlew build test

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'workspace/alpakka/**/build/test-results/test/TEST-*.xml'
summary: true
65 changes: 65 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "staging" ]
pull_request:
branches: [ "staging" ]

# Daily at midnight
schedule:
- cron: '0 0 * * *'

permissions:
checks: write

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# Because of scheduled runs, by default run on default branch
with:
ref: staging
path: workspace/alpakka

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

- name: Check out specs-java-libs repo
uses: actions/checkout@v4
with:
repository: specs-feup/specs-java-libs
path: workspace/specs-java-libs

- name: Check out lara-framework repo
uses: actions/checkout@v4
with:
repository: specs-feup/lara-framework
ref: staging
path: workspace/lara-framework

# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

# Setting up gradle multi-project would be helpful
- name: Build and Test AnyWeaver
working-directory: workspace/anyweaver/AnyWeaver
run: ./gradlew build test

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'workspace/alpakka/**/build/test-results/test/TEST-*.xml'
summary: true

0 comments on commit 8f4401f

Please sign in to comment.