adding missing dependency #25
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: Run Tests | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
env: | |
PKG_NAME: TA-Lib | |
PKG_UBUNTU: ~ | |
PKG_HOMEBREW: ~ | |
PKG_MSYS2_MINGW64: ~ | |
PKG_MSYS2_MINGW64_DEPS: >- | |
base-devel | |
unzip | |
mingw-w64-x86_64-toolchain | |
mingw-w64-x86_64-perl | |
mingw-w64-x86_64-curl | |
mingw-w64-x86_64-cmake | |
jobs: | |
dist: | |
name: Make distribution using Module::Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Cache ~/perl5 | |
uses: actions/cache@v2 | |
with: | |
key: ${{ runner.os }}-dist-locallib | |
path: ~/perl5 | |
- name: Perl version | |
run: | | |
perl -v | |
- name: Install cpanm | |
run: | | |
curl -L https://cpanmin.us | perl - --sudo App::cpanminus | |
- name: Install local::lib | |
run: | | |
cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) | |
- name: Install configure deps | |
shell: bash | |
run: | | |
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) | |
cpanm -n Module::Build Alien::Build Alien::Build::MB Software::License Alien::Build::Plugin::Download::GitHub | |
- name: Make distribution | |
shell: bash | |
run: | | |
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) | |
perl ./Build.PL | |
perl ./Build installdeps | |
perl ./Build distdir | |
mv ./Alien-TALib-* ./build-dir | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: ./build-dir | |
test: | |
needs: dist | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
# bash on macos and linux | |
# powershell on windows + strawberry perl | |
# msys2 {0} on windows + msys2 | |
shell: >- | |
${{ fromJSON( '["", "bash {0}"]' )[ startsWith(matrix.os, 'ubuntu-' ) || startsWith(matrix.os, 'macos-') ] | |
}}${{ fromJSON( '["", "powershell {0}"]' )[ startsWith(matrix.os, 'windows-') && matrix.dist == 'strawberry' ] | |
}}${{ fromJSON( '["", "msys2 {0}"]' )[ startsWith(matrix.os, 'windows-') && matrix.dist == 'msys2' ] }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
perl-version: ['5.16', '5.20', '5.30', '5.34'] | |
alien-install-type: [ 'share' ] | |
include: | |
# Windows strawberry | share | |
- { perl-version: '5.34' , os: windows-latest , dist: strawberry , alien-install-type: 'share' } | |
# Windows msys2 | share | |
- { perl-version: '5.34' , os: windows-latest , dist: msys2 , alien-install-type: 'share' } | |
# macOS | share | |
- { perl-version: '5.34' , os: macos-11 , alien-install-type: 'share' } | |
name: Perl ${{ matrix.perl-version }} on ${{ matrix.os }} with install-type ${{ matrix.alien-install-type }}, dist ${{ matrix.dist }} | |
steps: | |
- name: Get dist artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
# Setup system package | |
- name: Setup system ${{ env.PKG_NAME }} (apt) | |
if: runner.os == 'Linux' && matrix.alien-install-type == 'system' | |
run: | | |
sudo apt-get -y update && sudo apt-get install -y ${{ env.PKG_UBUNTU }} | |
- name: Setup system ${{ env.PKG_NAME }} (homebrew) | |
if: runner.os == 'macOS' && matrix.alien-install-type == 'system' | |
run: | | |
brew install ${{ env.PKG_HOMEBREW }} | |
- name: Set up MSYS2 | |
uses: msys2/setup-msys2@v2 | |
if: runner.os == 'Windows' && matrix.dist == 'msys2' | |
with: | |
update: true | |
install: ${{ env.PKG_MSYS2_MINGW64_DEPS }} | |
- name: Set up ${{ env.PKG_NAME }} (MSYS2/MinGW pacman) | |
if: runner.os == 'Windows' && matrix.dist == 'msys2' && matrix.alien-install-type == 'system' | |
shell: msys2 {0} | |
run: | | |
pacman -S --needed --noconfirm ${{ env.PKG_MSYS2_MINGW64 }} | |
- name: Setup homebrew deps | |
if: runner.os == 'macOS' | |
run: | | |
brew install libffi | |
# Setup Perl | |
- name: Set up perl | |
uses: shogo82148/actions-setup-perl@v1 | |
if: runner.os != 'Windows' | |
with: | |
perl-version: ${{ matrix.perl-version }} | |
- name: Set up perl (Strawberry) | |
uses: shogo82148/actions-setup-perl@v1 | |
if: runner.os == 'Windows' && matrix.dist == 'strawberry' | |
with: | |
distribution: 'strawberry' | |
- run: perl -V | |
- name: Install cpanm | |
if: runner.os == 'Windows' && matrix.dist == 'msys2' | |
run: | |
yes | cpan -T App::cpanminus || true | |
- name: Install Perl deps | |
run: | | |
cpanm --notest --installdeps . | |
cpanm --notest FFI::Platypus | |
- name: Install share install deps before setting ALIEN_INSTALL_TYPE | |
if: matrix.alien-install-type == 'share' | |
run: | | |
cpanm --notest Alien::cmake3 | |
- name: Set ALIEN_INSTALL_TYPE | |
shell: bash | |
run: | | |
echo "ALIEN_INSTALL_TYPE=${{ matrix.alien-install-type }}" >> $GITHUB_ENV | |
- name: Run tests | |
run: | | |
cpanm --verbose --test-only . |