Skip to content

Commit

Permalink
Merge pull request #303 from Brooooooklyn/test-text
Browse files Browse the repository at this point in the history
test: strokeText and fillText
  • Loading branch information
Brooooooklyn authored Jul 11, 2021
2 parents 56ce0ba + 8ee0645 commit f9a5e21
Show file tree
Hide file tree
Showing 34 changed files with 639 additions and 327 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ rustflags = [
]

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-gnu-gcc"
rustflags = ["-C", "target-feature=-crt-static", "-C", "link-arg=-lgcc"]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
33 changes: 18 additions & 15 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ jobs:
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
build: pnpm build -- --target=aarch64-unknown-linux-gnu
- host: ubuntu-18.04
- host: ubuntu-latest
target: 'aarch64-unknown-linux-musl'
downloadTarget: 'aarch64-unknown-linux-gnu'
setup: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
build: yarn build --target aarch64-unknown-linux-musl
downloadTarget: 'aarch64-unknown-linux-musl'
docker: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL
docker pull ghcr.io/brooooooklyn/canvas/musl-builder:lts
docker tag ghcr.io/brooooooklyn/canvas/musl-builder:lts builder
build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/canvas -w /canvas builder sh -c "rustup toolchain install $(cat ./rust-toolchain) && rustup target add aarch64-unknown-linux-musl && pnpm build -- --target=aarch64-unknown-linux-musl"
- host: ubuntu-18.04
target: 'armv7-unknown-linux-gnueabihf'
downloadTarget: 'armv7-unknown-linux-gnueabihf'
Expand Down Expand Up @@ -130,7 +131,7 @@ jobs:
- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Pull latest image
run: ${{ matrix.settings.docker }}
Expand Down Expand Up @@ -173,6 +174,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Setup node
uses: actions/setup-node@v2
Expand All @@ -189,17 +192,17 @@ jobs:
- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: bindings-${{ matrix.settings.target }}
path: .

- name: List packages
run: ls -R .
shell: bash
- name: Download icudtl.dat
if: matrix.settings.host == 'windows-latest'
run: node ./scripts/release-skia-binary.js --download-icu

- name: Test bindings
run: pnpm test
Expand Down Expand Up @@ -239,7 +242,7 @@ jobs:
- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Download artifacts
uses: actions/download-artifact@v2
Expand All @@ -252,7 +255,7 @@ jobs:
shell: bash

- name: Test bindings
run: docker run --rm -v ~/.pnpm-store:/root/.pnpm-store -v $(pwd):/canvas -w /canvas node:${{ matrix.node }}-slim sh -c "npm install -g pnpm && pnpm install && pnpm test"
run: docker run --rm -v ~/.pnpm-store:/root/.pnpm-store -v $(pwd):/canvas -w /canvas node:${{ matrix.node }}-slim sh -c "npm install -g pnpm && pnpm install --ignore-scripts && pnpm test"

- name: Test failed
if: ${{ failure() }}
Expand Down Expand Up @@ -289,7 +292,7 @@ jobs:
- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Download artifacts
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -474,7 +477,7 @@ jobs:
- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Download all artifacts
uses: actions/download-artifact@v2
Expand Down
81 changes: 67 additions & 14 deletions .github/workflows/skia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
key: npm-cache-build-skia-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Upload release
run: node ./scripts/release-skia-binary.js --upload
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -131,12 +132,12 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
key: npm-cache-build-skia-darwin-aarch64-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Upload release
run: node ./scripts/release-skia-binary.js --upload --target=aarch64-apple-darwin
Expand Down Expand Up @@ -179,12 +180,12 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
key: npm-cache-build-skia-linux-x64-musl-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Upload release
run: node ./scripts/release-skia-binary.js --upload --target=x86_64-unknown-linux-musl
Expand Down Expand Up @@ -218,7 +219,9 @@ jobs:
shell: bash

- name: Install cross compile tools
run: sudo apt-get install g++-10-aarch64-linux-gnu gcc-10-aarch64-linux-gnu -y
run: |
sudo apt-get update
sudo apt-get install g++-10-aarch64-linux-gnu gcc-10-aarch64-linux-gnu -y
- name: Compile skia
run: node ./scripts/build-skia.js --target=aarch64-unknown-linux-gnu
Expand All @@ -227,18 +230,66 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
key: npm-cache-build-skia-linux-aarch64-gnu-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Upload release
run: node ./scripts/release-skia-binary.js --upload --target=aarch64-unknown-linux-gnu
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-aarch64-linux-musl:
if: "!contains(github.event.head_commit.message, 'skip skia')"

name: stable - linux-x64-musl - build skia
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
check-latest: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GH_CONTAINER_UNAME }}
password: ${{ secrets.GH_TOKEN }}

- name: Compile skia
run: |
docker pull ghcr.io/brooooooklyn/canvas/musl-builder:lts
docker tag ghcr.io/brooooooklyn/canvas/musl-builder:lts builder
docker run --user "$(id -u):$(id -g)" --rm -v $(pwd):/canvas -w /canvas builder node ./scripts/build-skia.js --target=aarch64-unknown-linux-musl
env:
PYTHONHTTPSVERIFY: 0

- name: Cache pnpm store
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: npm-cache-build-skia-linux-aarch64-musl-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile --ignore-scripts
- name: Upload release
run: node ./scripts/release-skia-binary.js --upload --target=aarch64-unknown-linux-musl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-armv7-linux-gnu:
if: "!contains(github.event.head_commit.message, 'skip skia')"

Expand Down Expand Up @@ -266,7 +317,9 @@ jobs:
shell: bash

- name: Install cross compile tools
run: sudo apt-get install gcc-10-arm-linux-gnueabihf g++-10-arm-linux-gnueabihf -y
run: |
sudo apt-get update
sudo apt-get install gcc-10-arm-linux-gnueabihf g++-10-arm-linux-gnueabihf -y
- name: Compile skia
run: node ./scripts/build-skia.js --target=armv7-unknown-linux-gnueabihf
Expand All @@ -275,12 +328,12 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
key: npm-cache-build-skia-linux-armv7-gnu-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Upload release
run: node ./scripts/release-skia-binary.js --upload --target=armv7-unknown-linux-gnueabihf
Expand Down Expand Up @@ -320,12 +373,12 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}
key: npm-cache-build-skia-android-aarch64-${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Setup pnpm
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
pnpm install --frozen-lockfile --ignore-scripts
- name: Upload release
run: node ./scripts/release-skia-binary.js --upload --target=aarch64-linux-android
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ Temporary Items
# Temporary example image output
example/*-tmp.*

icudtl.dat
icudtl.dat
.pnpm-store
1 change: 1 addition & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ npm install @napi-rs/canvas
| Linux x64 gnu |||||
| Linux x64 musl |||||
| Linux aarch64 gnu |||||
| Linux aarch64 musl |||||
| Linux arm gnueabihf |||||
| Linux aarch64 android |||||

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ npm install @napi-rs/canvas
| Linux x64 gnu |||||
| Linux x64 musl |||||
| Linux aarch64 gnu |||||
| Linux aarch64 musl |||||
| Linux arm gnueabihf |||||
| Linux aarch64 android |||||

Expand Down
Loading

0 comments on commit f9a5e21

Please sign in to comment.