Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple workflows #8

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build

on:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Cache m2 repo
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Validate with Maven
env:
MAVEN_OPTS: "-Xmx6144m"
run: mvn --batch-mode install
46 changes: 46 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish

on:
push:
branches: [ main ]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
server-id: github
settings-path: ${{ github.workspace }}

- name: Setup Maven settings.xml
uses: whelk-io/maven-settings-xml-action@v11
with:
servers:
'[
{
"id": "github",
"username": "${env.GITHUB_USERNAME}",
"password": "${env.GITHUB_TOKEN}"
}
]'

- name: Cache m2 repo
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.TOKEN }}
BUILD_ENV: 'github-actions'
MAVEN_OPTS: "-Xmx6144m"
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<sonatype.nexus.staging>1.6.7</sonatype.nexus.staging>
<maven.javadoc.version>3.4.1</maven.javadoc.version>
<maven.assembly.version>3.4.2</maven.assembly.version>
<maven.plugin.plugin.version>3.9.0</maven.plugin.plugin.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -106,6 +107,11 @@
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>${maven.plugin.plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>${maven.source.plugin.version}</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
e.printStackTrace();
}

getLog().debug("Loaded files in classpath:");
for (URL url : classRealm.getURLs()) {
getLog().info(url.getFile());
getLog().debug(url.getFile());
}

Map<String, String> classes = getTestClassesWithTheirPath(filePath, generatePath);
Expand Down
Loading