Update workflow.yml #6
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
name: CI | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
types: [opened, synchronize, reopened, labeled, unlabeled] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
ocaml-compiler: | |
- "5.2" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install OCaml | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
- name: Remove existing FFmpeg | |
run: | | |
sudo apt-get remove -y ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev | |
sudo apt-get autoremove -y | |
- name: Install FFmpeg v6 dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
pkg-config \ | |
autoconf \ | |
automake \ | |
cmake \ | |
git \ | |
build-essential \ | |
yasm \ | |
nasm | |
- name: Download and compile FFmpeg v6 | |
run: | | |
git clone --depth 1 --branch release/6.1 https://github.com/FFmpeg/FFmpeg.git ffmpeg | |
cd ffmpeg | |
./configure --disable-shared --enable-static | |
make -j$(nproc) | |
sudo make install | |
- name: Verify FFmpeg version | |
run: | | |
ffmpeg -version | head -n1 | |
pkg-config --modversion libavcodec | |
- name: Install dependencies | |
run: opam install . --deps-only --with-test | |
- name: Build SoundML libraries and executables | |
run: opam exec -- dune build | |
- name: Run tests | |
run: opam exec -- dune runtest | |
- name: Build SoundML documentation | |
run: opam install odoc && opam exec -- dune build @doc | |
- name: Upload odoc documentation | |
uses: actions/upload-artifact@v4 | |
with: | |
name: doc | |
path: | | |
_build/default/_doc/_html/soundml | |
_build/default/_doc/_html/odoc.support | |
lint-fmt: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout tree | |
uses: actions/checkout@v4 | |
- name: Install OCaml | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: "5.2" | |
dune-cache: true | |
- uses: ocaml/setup-ocaml/lint-fmt@v2 | |
deploy-site: | |
needs: [build, lint-fmt] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download odoc documentation | |
uses: actions/download-artifact@v4 | |
with: | |
name: doc | |
path: doc/ | |
- name: Move documentation | |
run: mv doc/soundml doc/doc | |
- name: Deploy to VPS Server | |
uses: easingthemes/ssh-deploy@main | |
with: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
ARGS: "-rlgoDzvc -i" | |
SOURCE: "/doc/" | |
REMOTE_HOST: ${{ secrets.HOST }} | |
REMOTE_USER: ${{ secrets.USERNAME }} | |
TARGET: ${{ secrets.PATH }} | |
EXCLUDE: "/ocaml/, *.md" |