deno.land / x / skia_canvas@0.5.8 / .github / workflows / ci.yml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122name: CI
on: push: branches: [main] pull_request: branches: [main]
jobs: fmt: runs-on: ubuntu-latest steps: - name: Setup repo uses: actions/checkout@v2
- name: Setup Deno uses: denoland/setup-deno@main with: deno-version: 'v1.x'
- name: Check Formatting run: deno fmt --check
test: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }}
steps: - name: Setup repo uses: actions/checkout@v3 with: submodules: true
- name: Setup Deno uses: denoland/setup-deno@main with: deno-version: 'v1.x'
- name: Setup Depot Tools (Unix) if: runner.os != 'Windows' run: | git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git echo "PATH=$(pwd)/depot_tools:$PATH" >> $GITHUB_ENV
- name: Setup Depot Tools (Windows) if: runner.os == 'Windows' run: | curl -o depot_tools.zip https://storage.googleapis.com/chrome-infra/depot_tools.zip mkdir depot_tools cd depot_tools 7z x ../depot_tools.zip cd .. echo "PATH=$(pwd)/depot_tools;$PATH" >> $GITHUB_ENV
- name: Install dependencies (Linux) if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install xorg-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libgl1-mesa-glx libglx-dev
- name: Download Skia Binaries env: SKIA_FROM_SOURCE: 0 run: deno task build-skia
- name: Setup Build Directory run: mkdir ./native/build
- name: Build Native Library (Unix) if: runner.os != 'Windows' run: deno task build
- name: Build Native Library (macOS x86_64) if: runner.os == 'macOS' env: TARGET_ARCH: x86_64 run: | deno task build-skia cp ./native/build/libnative_canvas{,_aarch64}.dylib deno task build-macos-x86_64 cp ./native/build/libnative_canvas{,_x86_64}.dylib cp ./native/build/libnative_canvas{_aarch64,}.dylib - name: Build Native Library (Windows) if: runner.os == 'Windows' run: deno task build-win
- name: Strip Native Library (Linux) if: runner.os == 'Linux' run: strip ./native/build/libnative_canvas.so
- name: Setup ICU Data if: runner.os == 'Windows' run: cp ./skia/out/Release/icudtl.dat ./native/build/Release/icudtl.dat
- name: Run Tests env: DENO_SKIA_LOCAL: 1 run: deno run -A --unstable test/test.ts
- name: Rename x86_64 binary (macOS) if: runner.os == 'macOS' run: cp ./native/build/libnative_canvas{_x86_64,}.dylib
- name: Release uses: softprops/action-gh-release@master if: ${{ github.ref == 'refs/heads/main' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: "release draft" draft: true files: | skia/out/Release/icudtl.dat native/build/libnative_canvas.so native/build/libnative_canvas.dylib native/build/libnative_canvas_aarch64.dylib native/build/Release/native_canvas.dll
Version Info