Skip to content

[fix/ISSUE-47] Patch duktaped files to support building for MacOS #174

[fix/ISSUE-47] Patch duktaped files to support building for MacOS

[fix/ISSUE-47] Patch duktaped files to support building for MacOS #174

Workflow file for this run

name: Unit tests
on: [push]
jobs:
unit_test:
strategy:
matrix:
os: [ { name: ubuntu-20.04, extension: '' } , { name: windows-2019, extension: '.exe' }, { name: macos-latest, extension: '' } ]
runs-on: ${{ matrix.os.name }}
steps:
- uses: actions/checkout@v1
- uses: mihails-strasuns/setup-dlang@v1
name: Install DMD
- name: Fix duktaped build on OSX
if: matrix.os.name == 'macos-latest'
run: |
dub upgrade
sed -i -e 's/version(Posix)/version(linux)/g' ~/.dub/packages/duktape/0.4.0/duktape/source/duk_config.d
sed -i -e 's/-linux/-posix/g' ~/.dub/packages/duktape/0.4.0/duktape/dub.json
- name: Build
run: dub build
- name: Unit tests
run: dub test --coverage
- uses: actions/cache/save@v3
id: cache
with:
path: youtube-d${{ matrix.os.extension }}
key: youtube-d-${{ matrix.os.name }}
console_test:
strategy:
matrix:
os: [ { name: ubuntu-20.04, command: sh tests.sh, extension: '' } , { name: windows-2019, command: powershell.exe -file tests.ps1, extension: '.exe' }, { name: macos-latest, command: sh tests-macos.sh, extension: '' }]
runs-on: ${{ matrix.os.name }}
needs: unit_test
steps:
- uses: actions/checkout@v1
- uses: actions/cache/restore@v3
id: cache
with:
path: youtube-d${{ matrix.os.extension }}
key: youtube-d-${{ matrix.os.name }}
- name: Download libcurl.dll
if: matrix.os.name == 'windows-2019'
run: |
curl -LO https://downloads.dlang.org/other/libcurl-7.68.0-WinSSL-zlib-x86-x64.zip
tar -xf libcurl-7.68.0-WinSSL-zlib-x86-x64.zip
xcopy dmd2\windows\bin64\libcurl.dll .
- name: e2e tests
run: ${{ matrix.os.command }}