|
| 1 | +name: Checks |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + Unix: |
| 7 | + strategy: |
| 8 | + matrix: |
| 9 | + os: [ubuntu-latest] |
| 10 | + fail-fast: false |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v3 |
| 15 | + with: |
| 16 | + fetch-depth: 1 |
| 17 | + - uses: actions/setup-java@v5 |
| 18 | + with: |
| 19 | + distribution: 'corretto' |
| 20 | + java-version: '21' |
| 21 | + - uses: FedericoCarboni/setup-ffmpeg@v3 |
| 22 | + id: setup-ffmpeg |
| 23 | + with: |
| 24 | + ffmpeg-version: release |
| 25 | + - name: embARC-maj |
| 26 | + run: | |
| 27 | + git clone --depth=1 https://github.com/PortalMedia/embARC-maj.git |
| 28 | + - name: Compile |
| 29 | + run: | |
| 30 | + sed -i.bak 's/com.portalmedia.embarc.gui.Launcher/com.portalmedia.embarc.cli.Main/g' build.gradle |
| 31 | + ./gradlew build |
| 32 | + - name: Check |
| 33 | + run: | |
| 34 | + ffmpeg -f lavfi -i "testsrc2=size=1920x1080:rate=30" -vframes 1 -pix_fmt rgb48le 000001.dpx |
| 35 | + echo -n '{"COPYRIGHT_STATEMENT": "PLACEHOLDERTEXT"}' > copyright.json |
| 36 | + java -jar build/libs/embARC-$(<Project/version.txt)-all.jar 000001.dpx -applyChangesFromJSON copyright.json |
| 37 | + java -jar build/libs/embARC-$(<Project/version.txt)-all.jar 000001.dpx -json 000001.dpx.json |
| 38 | + grep "PLACEHOLDERTEXT" 000001.dpx.json |
| 39 | +
|
| 40 | + Windows: |
| 41 | + runs-on: windows-latest |
| 42 | + steps: |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v3 |
| 45 | + with: |
| 46 | + fetch-depth: 1 |
| 47 | + - uses: actions/setup-java@v5 |
| 48 | + with: |
| 49 | + distribution: 'corretto' |
| 50 | + java-version: '21' |
| 51 | + - uses: FedericoCarboni/setup-ffmpeg@v3 |
| 52 | + id: setup-ffmpeg |
| 53 | + with: |
| 54 | + ffmpeg-version: release |
| 55 | + - name: embARC-maj |
| 56 | + run: | |
| 57 | + # Don't use git clone because it's fail on Windows due to invalid path (.metadata/.plugins/org.eclipse.core.runtime/.settings/org.springframework.ide.eclipse.boot.dash:Cloud Foundry.prefs') |
| 58 | + Invoke-WebRequest -Uri "https://github.com/PortalMedia/embARC-maj/archive/refs/heads/master.zip" -OutFile "embARC-maj.zip" |
| 59 | + Expand-Archive -Path "embARC-maj.zip" -DestinationPath "." |
| 60 | + Rename-Item -Path "embARC-maj-master" -NewName "embARC-maj" |
| 61 | + - name: Compile |
| 62 | + run: | |
| 63 | + (Get-Content build.gradle) -replace 'com.portalmedia.embarc.gui.Launcher', 'com.portalmedia.embarc.cli.Main' | Set-Content build.gradle |
| 64 | + .\gradlew.bat build |
| 65 | + - name: Check |
| 66 | + run: | |
| 67 | + ffmpeg -f lavfi -i "testsrc2=size=1920x1080:rate=30" -vframes 1 -pix_fmt rgb48le 000001.dpx |
| 68 | + '{"COPYRIGHT_STATEMENT": "PLACEHOLDERTEXT"}' | Set-Content copyright.json -NoNewline |
| 69 | + $version = Get-Content Project/version.txt |
| 70 | + java -jar "build/libs/embARC-$version-all.jar" 000001.dpx -applyChangesFromJSON copyright.json |
| 71 | + java -jar "build/libs/embARC-$version-all.jar" 000001.dpx -json 000001.dpx.json |
| 72 | + if (-not (Select-String -Pattern "PLACEHOLDERTEXT" -Path "000001.dpx.json")) { throw "PLACEHOLDERTEXT not found" } |
0 commit comments