Skip to content

Commit

Permalink
Add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
agentgt committed Nov 13, 2024
1 parent dfe34af commit 1b5eb16
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
32 changes: 32 additions & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Analyze

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

jobs:
analyze:

strategy:
matrix:
profile: ['checkerframework', 'errorprone']

runs-on: ubuntu-latest
env:
BUILD_NUMBER: "${{github.run_number}}"
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode --no-transfer-progress"

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Install maven modules
run: ./mvnw $MAVEN_CLI_OPTS install -Dmaven.javadoc.skip -DskipTests -Dmaven.source.skip=true
- name: Analyze with ${{ matrix.profile }}
run: bin/analyze.sh ${{ matrix.profile }}
49 changes: 49 additions & 0 deletions .github/workflows/apidoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: mvn install
run: ./mvnw --batch-mode --no-transfer-progress -Pdoc clean install -DskipTests=true
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'target/reports/apidocs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
47 changes: 47 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build with Maven

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

jobs:
build:

runs-on: ubuntu-latest
env:
BUILD_NUMBER: "${{github.run_number}}"
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode --no-transfer-progress"

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and Test with Maven
run: ./mvnw $MAVEN_CLI_OPTS clean verify
- name: Upload Test Results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: '**/target/surefire-reports/TEST-*.xml'
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# slug: jstachio/rainbowgum
# fail_ci_if_error: true
# disable_search: true
# files: ${{ github.workspace }}/rainbowgum/target/site/jacoco-aggregate/jacoco.xml
16 changes: 16 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Test Report'
on:
workflow_run:
workflows: ['Build with Maven']
types:
- completed
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: test-results
name: Maven Surefire Tests
path: '**/target/surefire-reports/TEST-*.xml'
reporter: java-junit
21 changes: 21 additions & 0 deletions .m2/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<settings>
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<servers>
<server>
<id>github</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
<profiles>
<profile>
<id>github</id>
<properties>
<format.validate>true</format.validate>
<codecover>true</codecover>
</properties>
</profile>
</profiles>
</settings>

0 comments on commit 1b5eb16

Please sign in to comment.