diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..e1d1cc74 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 1db77236..2853879a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -18,15 +18,15 @@ jobs: strategy: matrix: # Long term supported versions - java-version: [8, 11, 17, 21] + java-version: [11, 17, 21] # TODO Should we test locales? The old travis setup did, see: # https://github.com/bramp/ffmpeg-cli-wrapper/pull/55 name: JDK ${{ matrix.java-version }} - + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up FFmpeg uses: FedericoCarboni/setup-ffmpeg@v3 @@ -35,7 +35,7 @@ jobs: ffmpeg-version: release - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java-version }} distribution: 'temurin' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..2853879a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,53 @@ +# This workflow will build a Java project with Maven, 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-maven + +name: Java CI with Maven + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + # Enable debugging to help resolve: + # https://github.com/federicocarboni/setup-ffmpeg/issues/19 + environment: debug + strategy: + matrix: + # Long term supported versions + java-version: [11, 17, 21] + + # TODO Should we test locales? The old travis setup did, see: + # https://github.com/bramp/ffmpeg-cli-wrapper/pull/55 + + name: JDK ${{ matrix.java-version }} + + steps: + - uses: actions/checkout@v4 + + - name: Set up FFmpeg + uses: FedericoCarboni/setup-ffmpeg@v3 + id: setup-ffmpeg + with: + ffmpeg-version: release + + - name: Set up JDK ${{ matrix.java-version }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + cache: maven + + - name: Compile with Maven + run: mvn --batch-mode --update-snapshots compile + + - name: Test with Maven, Package and Verify with Maven + run: mvn --batch-mode --update-snapshots verify -Dgpg.skip + + # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive + - name: Update dependency graph + uses: advanced-security/maven-dependency-submission-action@v4 + continue-on-error: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..b15e6c8b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-yaml + args: [--allow-multiple-documents] + - id: end-of-file-fixer + exclude: ^src/test/resources/ + - id: trailing-whitespace + exclude: ^src/test/resources/ +- repo: local + hooks: + - id: maven-format + name: Maven Format + entry: mvn fmt:format + language: system + types: [java] + pass_filenames: false + + - id: maven-test + name: Maven Test + entry: mvn test + language: system + types: [java] + pass_filenames: false diff --git a/README.md b/README.md index 52066738..d654f6fa 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ by Andrew Brampton ([bramp.net](https://bramp.net)) (c) 2013-2024 A fluent interface for running FFmpeg from Java. -![Java](https://img.shields.io/badge/Java-8+-brightgreen.svg) -[![Build Status](https://github.com/bramp/ffmpeg-cli-wrapper/actions/workflows/maven.yml/badge.svg)](https://github.com/bramp/ffmpeg-cli-wrapper/actions/workflows/maven.yml) +![Java](https://img.shields.io/badge/Java-11+-brightgreen.svg) +[![Build Status](https://github.com/bramp/ffmpeg-cli-wrapper/actions/workflows/test.yml/badge.svg)](https://github.com/bramp/ffmpeg-cli-wrapper/actions/workflows/test.yml) [![Coverage Status](https://img.shields.io/coveralls/bramp/ffmpeg-cli-wrapper.svg)](https://coveralls.io/github/bramp/ffmpeg-cli-wrapper) [![Maven](https://img.shields.io/maven-central/v/net.bramp.ffmpeg/ffmpeg.svg)](http://mvnrepository.com/artifact/net.bramp.ffmpeg/ffmpeg) [![Libraries.io](https://img.shields.io/librariesio/github/bramp/ffmpeg-cli-wrapper.svg)](https://libraries.io/github/bramp/ffmpeg-cli-wrapper) @@ -16,7 +16,7 @@ A fluent interface for running FFmpeg from Java. ## Install -We currently support Java 8 and above. Use Maven to install the dependency. +We currently support Java 11 and above. Use Maven to install the dependency. ```xml @@ -78,7 +78,7 @@ FFprobe ffprobe = new FFprobe("/path/to/ffprobe"); FFmpegProbeResult probeResult = ffprobe.probe("input.mp4"); FFmpegFormat format = probeResult.getFormat(); -System.out.format("%nFile: '%s' ; Format: '%s' ; Duration: %.3fs", +System.out.format("%nFile: '%s' ; Format: '%s' ; Duration: %.3fs", format.filename, format.format_long_name, format.duration @@ -158,7 +158,7 @@ mvn clean javadoc:aggregate scm-publish:publish-scm mvn versions:display-plugin-updates # Library Dependencies -mvn versions:display-dependency-updates +mvn versions:display-dependency-updates ``` ## Install FFmpeg on Ubuntu diff --git a/pom.xml b/pom.xml index 70faedbe..4ffa9399 100644 --- a/pom.xml +++ b/pom.xml @@ -535,7 +535,7 @@ org.codehaus.mojo taglist-maven-plugin - 3.0.0 + 3.2.2 true