-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [ "main", "add-java-workflow" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
# 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@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 | ||
- name: Download a Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
# Name of the artifact to download. If unspecified, all artifacts for the run are downloaded. | ||
name: onnx_model | ||
# Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE | ||
path: raw-files | ||
# The GitHub token used to authenticate with the GitHub API. This is required when downloading artifacts from a different repository or from a different workflow run. If this is not specified, the action will attempt to download artifacts from the current repository and the current workflow run. | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} # optional | ||
# # The repository owner and the repository name joined together by "/". If github-token is specified, this is the repository that artifacts will be downloaded from. | ||
# repository: # optional, default is ${{ github.repository }} | ||
# The id of the workflow run where the desired download artifact was uploaded from. If github-token is specified, this is the run that artifacts will be downloaded from. | ||
run-id: python-app # optional, default is ${{ github.run_id }} | ||
|
||
|
||
# This job is responsible for generating and submitting a dependency graph for the project. | ||
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. | ||
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md | ||
dependency-submission: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Generate and submit dependency graph | ||
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
build: | ||
build-python: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|
@@ -32,8 +32,8 @@ jobs: | |
# Hugging Face Model to ONNX | ||
python -m transformers.onnx --opset 16 --atol 0.005 --feature=token-classification --model=xlm-roberta-large-finetuned-conll03-english onnx/ | ||
- name: Upload a Build Artifact | ||
# Upload the ONNX model as an artifact | ||
- name: Upload ONNX model | ||
uses: actions/[email protected] | ||
with: | ||
# Artifact name | ||
|
@@ -47,4 +47,60 @@ jobs: | |
# Compression level (0-9, default: 6) | ||
compression-level: # optional | ||
# Overwrite existing artifact (default: false) | ||
overwrite: true # optional | ||
overwrite: true # optional | ||
|
||
# Build Java application with Gradle | ||
build-java: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
needs: build-python | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
# Set up JDK 17 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
# 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@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 | ||
|
||
|
||
- name: Download ONNX model from Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: onnx_model | ||
path: raw-files | ||
run-id: ${{ github.run_id }} | ||
|
||
- name: See artifact contents | ||
run: tree raw-files | ||
|
||
|
||
|
||
|
||
# This job is responsible for generating and submitting a dependency graph for the project. | ||
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. | ||
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md | ||
dependency-submission: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Generate and submit dependency graph | ||
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 |