Skip to content

download artifacts

download artifacts #17

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main", "add-java-workflow" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -q transformers[onnx] transformers[sentencepiece] torch
- name: Hugging Face Model to ONNX
run: |
# 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/
# Upload the ONNX model as an artifact
- name: Upload ONNX model
uses: actions/upload-artifact@v4.3.6
with:
# Artifact name
name: onnx_model # default: artifact
# Files to upload
path: onnx/
# Behavior if no files found: warn, error, ignore
if-no-files-found: warn
# Expiration in days (1-90, 0 for default)
retention-days: 6 # optional
# Compression level (0-9, default: 6)
compression-level: # optional
# Overwrite existing artifact (default: false)
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/download-artifact@v4.1.8
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