Skip to content

Commit

Permalink
Fix and improve workflows
Browse files Browse the repository at this point in the history
Adapt to newer repositories:
- use MacPorts for python2.7
- on macOS, kaldi uses Accelerate framework
- use workaround for python2.7 on RaspberryPi
- fix python2.7 name on ubuntu 22

Also run on various versions of ubuntu and macOS

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
  • Loading branch information
pguyot committed Apr 30, 2024
1 parent 4954deb commit 164c40e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 39 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/build-kaldi-rpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ jobs:
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
base_image: raspi_2_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
base_image: raspi_3_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
base_image: raspi_4_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
Expand All @@ -76,7 +76,7 @@ jobs:
/opt/kaldi
commands: |
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool make
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool make
apt-get upgrade -y wget ca-certificates
cd tools
bash extras/install_openblas.sh
Expand Down Expand Up @@ -139,15 +139,15 @@ jobs:
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
base_image: raspi_2_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
base_image: raspi_3_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
base_image: raspi_4_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
Expand All @@ -174,7 +174,7 @@ jobs:
/opt/kaldi
commands: |
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool make
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool make
apt-get upgrade -y wget ca-certificates
cd tools
OPENFST_CONFIGURE="--enable-shared --with-pic --disable-bin" make openfst_compiled -j 4
Expand Down Expand Up @@ -238,15 +238,15 @@ jobs:
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
base_image: raspi_2_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
base_image: raspi_3_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
base_image: raspi_4_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -310,7 +310,7 @@ jobs:
/opt/kaldi
commands: |
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool
cd tools
bash extras/check_dependencies.sh
make cub sctk_made sph2pipe -j 4
Expand Down Expand Up @@ -370,15 +370,15 @@ jobs:
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
base_image: raspi_2_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
base_image: raspi_3_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
base_image: raspi_4_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -435,7 +435,7 @@ jobs:
OPENFST_VERSION=${{ steps.get-openfst-version.outputs.OPENFST_VERSION }}
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool
cd src
OPENFST_VER=${OPENFST_VERSION} ./configure --shared
make depend -j 4
Expand Down Expand Up @@ -496,15 +496,15 @@ jobs:
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
base_image: raspi_2_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
base_image: raspi_3_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
base_image: raspi_4_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -578,7 +578,7 @@ jobs:
/opt/kaldi
commands: |
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool
cd src
make chainbin featbin fgmmbin fstbin gmmbin ivectorbin kwsbin latbin lmbin -j 4
- name: Create tarball for step 1
Expand Down Expand Up @@ -637,15 +637,15 @@ jobs:
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
base_image: raspi_2_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
base_image: raspi_3_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
base_image: raspi_4_bullseye:20230102
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -722,7 +722,7 @@ jobs:
commands: |
. /etc/os-release && echo "$ID$VERSION_ID-`uname -m`" > release_name
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool
cd src
make -j 4
- name: Create tarballs with files
Expand Down
41 changes: 26 additions & 15 deletions .github/workflows/build-kaldi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,50 @@ jobs:
build:
name: "Build kaldi"
strategy:
fail-fast: false
matrix:
target: [macos, ubuntu]
target: [macos12, macos13, macos14, ubuntu20, ubuntu22]
include:
- target: macos
os: macos-latest
- target: macos12
os: macos-12
install_dir: /usr/local/opt
pkgconfig_dir: /usr/local/lib/pkgconfig
- target: ubuntu
os: ubuntu-latest
- target: macos13
os: macos-13
install_dir: /usr/local/opt
pkgconfig_dir: /usr/local/lib/pkgconfig
- target: macos14
os: macos-14
install_dir: /usr/local/opt
pkgconfig_dir: /usr/local/lib/pkgconfig
- target: ubuntu20
os: ubuntu-20.04
install_dir: /opt
pkgconfig_dir: /usr/lib/pkgconfig
- target: ubuntu22
os: ubuntu-22.04
install_dir: /opt
pkgconfig_dir: /usr/lib/pkgconfig
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install MacPorts on macos
if: startsWith(matrix.os, 'macos')
uses: melusina-org/setup-macports@v1
- name: Install dependencies on macos
shell: bash
if: startsWith(matrix.os, 'macos')
shell: bash
run: |
brew update
brew install gawk automake
brew install gawk automake subversion sox libtool
brew reinstall gcc
port install python27
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt-get update -y --allow-releaseinfo-change
sudo apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
sudo apt-get install --no-install-recommends -y subversion gawk python2.7 python3 automake autoconf git sox gfortran libtool
sudo update-ca-certificates
- name: Install MKL
if: startsWith(matrix.os, 'ubuntu')
Expand All @@ -42,12 +59,6 @@ jobs:
run: |
sudo mkdir -p ${{ matrix.install_dir }}
cd .. && sudo mv kaldi ${{ matrix.install_dir }}/kaldi && sudo ln -s ${{ matrix.install_dir }}/kaldi kaldi
- name: Compile OpenBLAS on macos
if: startsWith(matrix.os, 'macos')
shell: bash
run: |
cd ${{ matrix.install_dir }}/kaldi/tools
bash extras/install_openblas.sh
- id: get-openfst-version
name: Determine OpenFST version
shell: bash
Expand Down Expand Up @@ -75,7 +86,7 @@ jobs:
OPENFST_VERSION: ${{ steps.get-openfst-version.outputs.OPENFST_VERSION }}
run: |
cd ${{ matrix.install_dir }}/kaldi/src
OPENFST_VER=${OPENFST_VERSION} ./configure --shared --mathlib=OPENBLAS
OPENFST_VER=${OPENFST_VERSION} ./configure --shared
- name: Configure kaldi on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
Expand Down

0 comments on commit 164c40e

Please sign in to comment.