name: Skia feature

on:
  push:
    paths:
      - ".gitea/workflows/skia.yml"
      - "Cargo.toml"
      - "Cargo.lock"
      - "crates/libremetaverse-types/**"
      - "crates/libremetaverse-imaging/**"
      - "crates/libremetaverse-imaging-skia/**"
  pull_request:
    paths:
      - ".gitea/workflows/skia.yml"
      - "Cargo.toml"
      - "Cargo.lock"
      - "crates/libremetaverse-types/**"
      - "crates/libremetaverse-imaging/**"
      - "crates/libremetaverse-imaging-skia/**"
  workflow_dispatch:

jobs:
  linux:
    runs-on: ubuntu-latest
    env:
      FORCE_SKIA_BINARIES_DOWNLOAD: "1"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - name: Install native link prerequisites
        run: |
          sudo apt-get update
          sudo apt-get install --yes build-essential clang curl ninja-build pkg-config python3 libfontconfig1-dev libfreetype6-dev
      - name: Test default and Skia feature builds
        run: |
          cargo test -p libremetaverse-imaging-skia --no-default-features
          cargo test -p libremetaverse-imaging-skia --features skia
          cargo package -p libremetaverse-imaging-skia --list
