Skip to content

Commit

Permalink
Add test typescript to CI (#64)
Browse files Browse the repository at this point in the history
* add test typescript to CI

* see if test can fail

* make test pass
  • Loading branch information
Pistonight committed Sep 27, 2023
1 parent 7a3e829 commit 22df33c
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 18 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-typescript:
name: Test TypeScript Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: dtolnay/rust-toolchain@stable
- uses: baptiste0928/cargo-install@v2
with:
crate: regen-lang
- uses: baptiste0928/cargo-install@v2
with:
crate: wasm-pack
- run: task themes:ci client:ci --output group
- run: task themes:build build:wasm build:types --output group
- run: task client:test
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ EXPOSE 80
ENV APP_DIR=/opt/app
RUN mkdir -p $APP_DIR
# Copy outputs
COPY ./dist $APP_DIR
COPY ./target/x86_64-unknown-linux-musl/release/celerserver $APP_DIR/celerserver
COPY ./docs/src/.vitepress/dist $APP_DIR/docs
COPY ./web-client/dist $APP_DIR/app

WORKDIR $APP_DIR

Expand Down
22 changes: 5 additions & 17 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ tasks:
docker:
deps: [build]
desc: Build docker container
cmds:
- task: docker:build

docker:build:
cmds:
- docker build -t pistonite/celer . --no-cache

Expand All @@ -75,40 +79,24 @@ tasks:
build:
desc: Build production assets
deps:
- build:docs
- docs:build
- build:server
- build:client

build:docs:
internal: true
deps:
- docs:build
cmds:
- rm -rf dist/docs
- mkdir -p dist/docs
- cp -r docs/src/.vitepress/dist/* dist/docs

build:server:
internal: true
deps:
- core:grammar
cmds:
- rm -f dist/celerserver
- mkdir -p dist
- rustup default stable
- cross build --bin celerserver --release --target x86_64-unknown-linux-musl
- cp target/x86_64-unknown-linux-musl/release/celerserver dist/celerserver

build:client:
deps:
- themes:build
- build:wasm
- build:types
cmds:
- rm -rf dist/app
- mkdir -p dist/app
- task: client:build
- cp -r web-client/dist/* dist/app

build:wasm:
dir: ./compiler-wasm
Expand Down
16 changes: 16 additions & 0 deletions web-client/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,19 @@ tasks:
eslint:
cmds:
- npx eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --cache {{.ESLINT_ARGS}}

test:
desc: Run tests in web client
cmds:
- task: jest

watch:
desc: Run tests in web client in watch mode
cmds:
- task: jest
vars:
ARGS: --watch

jest:
cmds:
- npx jest --config tools/test/jest.config.cjs {{.ARGS}}

0 comments on commit 22df33c

Please sign in to comment.