Skip to content

Commit

Permalink
Merge pull request #172 from samizdatco/maintenance-2024
Browse files Browse the repository at this point in the history
Maintenance 2024
  • Loading branch information
samizdatco authored Nov 20, 2024
2 parents e9b1a9c + f64c224 commit 5d76146
Show file tree
Hide file tree
Showing 94 changed files with 13,547 additions and 8,089 deletions.
38 changes: 9 additions & 29 deletions .github/workflows/arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,36 @@ on:
workflow_dispatch:

jobs:
server:
build-container:
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
libc: [glibc, musl]

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

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

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
tags: ghcr.io/${{ github.repository }}-${{ matrix.libc }}:latest
context: arch/${{ matrix.libc }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
push: true

pi:
runs-on: [self-hosted, linux, ARM]

steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Build and Push Docker Image
run: |
cd ${{ env.context }}
docker build . -t ${{ env.tag }}
docker push ${{ env.tag }}
env:
context: arch/arm
tag: ghcr.io/${{ github.repository }}-arm:latest
84 changes: 27 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,52 @@ on:
- "v*"

jobs:

linux-x86:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
libc: [glibc, musl]

container:
image: ${{ format('ghcr.io/{0}-{1}:latest', github.repository, matrix.libc) }}
options: --user github

steps:
- name: Install rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Use Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Checkout skia-canvas
uses: actions/checkout@v4
with:
path: skia-canvas

- name: Build module
run: |
cd skia-canvas
npm ci --ignore-scripts
npm run build -- --release --features vulkan,window,skia-safe/embed-freetype
mkdir -p $CARGO_HOME/registry
chown -R github $CARGO_HOME/registry
make optimized
- name: Package module
run: |
cd skia-canvas
npm test && npm run package
- name: Add to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -sL https://github.com/cli/cli/releases/download/v2.55.0/gh_2.55.0_linux_amd64.tar.gz | tar xz --strip-components=2
mv gh skia-canvas/node_modules/.bin
cd skia-canvas
npm run upload
linux-arm64:
runs-on:
- self-hosted
- linux
- ARM64
runs-on: [self-hosted, linux, ARM64]
strategy:
fail-fast: false
matrix:
libc: [glibc, musl]

container:
image: ${{ format('ghcr.io/{0}-{1}:latest', github.repository, matrix.libc) }}
options: --user 1000:1000
options: --user github

steps:
- name: Prepare workspace
Expand All @@ -72,57 +63,36 @@ jobs:
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
- name: Checkout skia-canvas
id: rust-skia
env:
SERVER: ${{ github.server_url }}
REPO: ${{ github.repository }}
REF: ${{ github.ref_name }}
run: |
git clone --depth 1 --branch ${GITHUB_REF_NAME} ${SERVER}/${REPO} skia-canvas
export TAG=$(make -sC skia-canvas skia-version)
make -sC skia-canvas with-local-skia
echo "VERSION=$TAG" >> $GITHUB_OUTPUT
echo REF ${GITHUB_REF_NAME}
- name: Checkout rust-skia
run: |
git clone --depth 1 --branch ${{ steps.rust-skia.outputs.VERSION }} https://github.com/rust-skia/rust-skia.git
cd rust-skia
git submodule update --init --depth 1 skia-bindings/skia
git submodule update --init --depth 1 skia-bindings/depot_tools
- name: Use system GN
if: ${{ matrix.libc == 'musl' }}
run: |
echo "#!/bin/true" > rust-skia/skia-bindings/skia/bin/fetch-gn
git clone --depth 1 --branch $REF ${SERVER}/${REPO} .
- name: Build module
run: |
cd skia-canvas
npm ci --ignore-scripts
npm run build -- --release --features vulkan,window,skia-safe/embed-freetype
make optimized
- name: Package module
run: |
cd skia-canvas
npm test && npm run package
- name: Add to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -sL https://github.com/cli/cli/releases/download/v2.55.0/gh_2.55.0_linux_arm64.tar.gz | tar xz --strip-components=2
mv gh skia-canvas/node_modules/.bin
cd skia-canvas
npm run upload
mac:
strategy:
fail-fast: false
matrix:
arch: [x86, arm64]
runs-on: ${{ matrix.arch == 'x86' && 'macos-13' || 'macos-latest' }}
runs-on: ${{ matrix.arch == 'x86' && 'macos-13' || 'macos-14' }}

steps:
- name: Checkout repository
Expand All @@ -138,16 +108,16 @@ jobs:
with:
toolchain: stable

- name: Use Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Build module
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
run: |
npm ci --ignore-scripts
npm run build -- --release --features metal,window
MACOSX_DEPLOYMENT_TARGET: 10.14
run: make optimized

- name: Package module
run: |
npm test && npm run package
run: npm test && npm run package

- name: Add to release
env:
Expand All @@ -172,14 +142,14 @@ jobs:
with:
toolchain: stable

- name: Use Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Build module
run: |
npm ci --ignore-scripts
npm run build -- --release --features vulkan,window
run: make optimized

- name: Package module
run: |
npm test && npm run package
run: npm test && npm run package

- name: Add to release
env:
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Use Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Build for Metal
if: ${{ matrix.os == 'macos-latest' }}
run: |
npm ci --ignore-scripts
npm run build -- --release --features metal,window
- name: Use Ninja
uses: seanmiddleditch/gha-setup-ninja@master

- name: Build for Vulkan
if: ${{ matrix.os != 'macos-latest' }}
run: |
npm ci --ignore-scripts
npm run build -- --release --features vulkan,window
- name: Build module
run: make optimized

- name: Run tests
run: npm test
run: |
npm test --verbose
Loading

0 comments on commit 5d76146

Please sign in to comment.