Skip to content

Commit

Permalink
Another test
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenraven committed Oct 9, 2024
1 parent 861bcbd commit 5bd1f84
Show file tree
Hide file tree
Showing 19 changed files with 330 additions and 5,271 deletions.
8 changes: 0 additions & 8 deletions .github/ci.json

This file was deleted.

70 changes: 30 additions & 40 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ permissions:
statuses: write

jobs:
configure:
name: Configure the build
setup:
name: Setup
runs-on: ubuntu-24.04
steps:
- name: Create the commit status check
Expand All @@ -34,78 +34,68 @@ jobs:
-f "target_url=${STATUS_URL}" \
-f "description=PR Check Workflow" \
-f "context=IMG.LY"
- uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
.github
- name: Construct build matrix
id: construct_matrix
shell: bash
run: |
set -x
jq --compact-output --raw-output '."build-and-test" | tostring | "matrix_packages=" + .' .github/ci.json | tee -a "$GITHUB_OUTPUT"
outputs:
matrix_packages: ${{ steps.construct_matrix.outputs.matrix_packages }}

test:
name: Test ${{ matrix.package }} for Node ${{ matrix.node-version }}
needs: [configure]
name: Test Node ${{ matrix.node-version }}
needs: [setup]
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node-version: [20.x, 21.x]
package: ${{ fromJson(needs.configure.outputs.matrix_packages) }}
node-version:
- '18.x'
- '20.x'
- '22.x'
env:
IMGLY_PACKAGE_DIR: ${{ matrix.package == '.' && github.workspace || format('{0}/packages/{1}', github.workspace, matrix.package) }}
CI_NODE_VERSION: ${{ matrix.node-version }}
CI_IS_PR: ${{ github.event_name == 'pull_request' }}
# In PRs, rebuild the changed packages, their dependents and dependencies only, unless the ci:build-all label is applied.
CI_PNPM_FILTER: ${{ (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:build-all')) && '...[origin/main]...' || '*' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0
lfs: true
- name: Use Node.js ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ env.CI_NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
node-version: ${{ env.CI_NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
working-directory: ${{ env.IMGLY_PACKAGE_DIR }}
shell: bash
run: yarn install
run: pnpm recursive install --filter "$CI_PNPM_FILTER" --frozen-lockfile
- name: Run checks
working-directory: ${{ env.IMGLY_PACKAGE_DIR }}
shell: bash
run: yarn run check:all
run: pnpm recursive run --filter "$CI_PNPM_FILTER" check:all
- name: Build
working-directory: ${{ env.IMGLY_PACKAGE_DIR }}
shell: bash
run: yarn run build
run: pnpm recursive run --filter "$CI_PNPM_FILTER" build
- name: Test
working-directory: ${{ env.IMGLY_PACKAGE_DIR }}
shell: bash
run: yarn run test
run: pnpm recursive run --filter "$CI_PNPM_FILTER" test
- name: Package
if: success() || failure()
working-directory: ${{ env.IMGLY_PACKAGE_DIR }}
shell: bash
run: yarn pack
- name: Upload
run: |
mkdir -p _ci_packs
pnpm recursive --filter "$CI_PNPM_FILTER" exec pnpm pack "--pack-destination=$PWD/_ci_packs"
- name: Upload packages
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}-ci-node${{ matrix.node-version }}.tgz.zip
path: '${{ env.IMGLY_PACKAGE_DIR }}/*.tgz'
name: ${{ github.event.repository.name }}-npm-packages-node${{ env.CI_NODE_VERSION }}.zip
path: '_ci_packs/*.tgz'
if-no-files-found: ignore
overwrite: true

summary:
name: Summary test status
needs: [test]
if: success() || failure()
if: always()
runs-on: ubuntu-24.04
steps:
- name: Update the commit status check
if: always()
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ examples/*/dist
yarn-error.log

.turbo
_ci_*
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Plugins enhance the capabilities of [CreativeEditor SDK (CE.SDK)](https://img.ly
- Customization: Tailor the functionality of CE.SDK to meet specific needs.
- Compatibility: Designed to work seamlessly with the latest version of CE.SDK.

> [!WARNING]
> The plugin APIs are still in development and thus marked as unstable in CE.SDK. While it is perfectly safe to use the plugins for the specified CE.SDK versions, the APIs might change in the future. Please be aware, if you write your own plugin based on the code in this repository.
# Currently Available Plugins

For more information about the particular plugins, please visit the according packages in this repository.

- [Background Removal](packages/plugin-background-removal-web/)
- [Cutouts](packages/plugin-cutout-library-web/)
- [Remote Asset Source](packages/plugin-remote-asset-source-web/)
- [Vectorizer](packages/plugin-vectorizer-web/)
2 changes: 1 addition & 1 deletion esbuild/plugin-dts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const dtsPlugin = {
dtsStdio = undefined;
dtsResolved = false;
log('Generating types...');
exec('yarn types:create', (error, stdio) => {
exec('pnpm run types:create', (error, stdio) => {
if (error) {
dtsError = error;
dtsStdio = stdio;
Expand Down
2 changes: 1 addition & 1 deletion examples/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"build": "tsc && vite build --force",
"build": "tsc && vite build",
"clean": "npx rimraf dist",
"purge": "npx rimraf node_modules",
"dev": "vite --clearScreen=false --force",
Expand Down
Loading

0 comments on commit 5bd1f84

Please sign in to comment.