Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework example project tests #711

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@ jobs:
cache: "npm"
cache-dependency-path: |
package-lock.json
examples/**/package-lock.json
# uv required for javascript tests
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
enable-cache: false
# go needed for fake_gcs_server used by the javascript tests
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "stable"
- run: npm install
- run: npm ci
- run: npm run format:fix
- name: Check for dirty working directory
run: git diff --exit-code
Expand Down Expand Up @@ -83,6 +82,36 @@ jobs:
name: client
path: dist/client
if: ${{ runner.os == 'Linux' }}
example-project-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "pnpm"
cache-dependency-path: |
examples/**/pnpm-lock.yaml
- uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "npm"
cache-dependency-path: |
package-lock.json
- run: npm ci
- run: npm run example-project-test -- --reporter=html
- name: Upload report and built clients
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: example-project-test-results
path: |
playwright-report/
examples/*/*/dist/

# Builds Python package and runs Python tests
#
Expand Down Expand Up @@ -164,7 +193,7 @@ jobs:
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> "$GITHUB_OUTPUT"
- run: npm install
- run: npm ci
- run: |
build_info="{'tag':'$(git describe --always --tags)', 'url':'https://github.com/google/neuroglancer/commit/$(git rev-parse HEAD)', 'timestamp':'$(date)'}"
npm run build-python -- --no-typecheck --no-lint --define NEUROGLANCER_BUILD_INFO="${build_info}"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ tsconfig.tsbuildinfo
.eslintcache
/lib
/.firebase
/test-results
/playwright-report
-/docs/python/api/index.rst
/docs/python/api/*.rst
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ zarr.json
.parcel-cache
dist
/lib
/docs/_build/
/.ruff_cache
package.json
package-lock.json
.venv
pnpm-lock.yaml
6 changes: 3 additions & 3 deletions build_tools/after-version-change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ await execFileAsync("npm", ["run", "build-package"], {
cwd: rootDir,
});

// Update package-lock.json files in examples.
// Update lockfiles in examples.
await Promise.all(
(await glob("examples/*/*/package.json", { absolute: true, cwd: rootDir }))
.map((examplePackageJsonPath) => path.dirname(examplePackageJsonPath))
.map(async (exampleDir: string) => {
await execFileAsync("npm", ["install", "--no-audit", "--no-fund"], {
await execFileAsync("pnpm", ["install"], {
cwd: exampleDir,
});
}),
Expand All @@ -35,7 +35,7 @@ await execFileAsync(
"git",
[
"add",
...(await glob("examples/*/*/package-lock.json", {
...(await glob("examples/*/*/pnpm-lock.yaml", {
absolute: false,
cwd: rootDir,
})),
Expand Down
2 changes: 1 addition & 1 deletion build_tools/build-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function buildDeclarationFiles(
program.emit();
}

async function buildPackage(options: {
export async function buildPackage(options: {
inplace?: boolean;
skipDeclarations?: boolean;
}) {
Expand Down
2 changes: 1 addition & 1 deletion build_tools/update-example-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ await Promise.all(
await execFileAsync("npx", ["npm-check-updates", "-u"], {
cwd: exampleDir,
});
await execFileAsync("npm", ["install", "--no-audit", "--no-fund"], {
await execFileAsync("pnpm", ["install"], {
cwd: exampleDir,
});
}),
Expand Down
2 changes: 0 additions & 2 deletions docs/python/api/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions examples/parcel/parcel-project-built/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@parcel/config-default": "^2.13.3",
"@parcel/transformer-inline-string": "^2.12.0",
"parcel": "^2.12.0",
"parcel-namer-rewrite": "^2.10.3-rc.2"
Expand Down
Loading
Loading