Skip to content

test matrix

test matrix #7

Workflow file for this run

name: Test and deploy
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install pnpm components
run: |
pnpm install
- name: Run pre-commit
uses: pre-commit/[email protected]
- name: Apply code modifications with pre-commit-ci-lite
uses: pre-commit-ci/lite-action@main
if: always()
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
packages:
- name: @uatp/components

Check failure on line 45 in .github/workflows/ci_cd.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci_cd.yml

Invalid workflow file

You have an error in your yaml syntax on line 45
directory: packages/components
run: |
pnpm build
pnpm test
- name: @uatp/template
directory: packages/create-web/template/web
run: |
# Template depends on component library, must build first
pnpm --filter=@uatp/components build
pnpm rust
pnpm python
pnpm build
pnpm test
- name: @uatp/create-web Rust
directory: .
run: |
npm exec ./packages/create-web -- --directory /tmp/rust --project-name rust --backend rust
cd /tmp/rust/web
pnpm install
pnpm rust
pnpm build
pnpm test
- name: @uatp/create-web Python
directory: .
run: |
npm exec ./packages/create-web -- --directory /tmp/python --project-name python --backend python
cd /tmp/python/web
pnpm install
pnpm python
pnpm build
pnpm test
- name: @uatp/create-web no-backend
directory: .
run: |
npm exec ./packages/create-web -- --directory /tmp/none --project-name none --backend none
cd /tmp/none/web
pnpm install
pnpm build
pnpm test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install wasm-pack
uses: jetli/[email protected]
- name: Cache WASM build
uses: actions/cache@v3
with:
path: packages/create-web/template/rust_backend/target
key: rust_backend
- name: Install dependencies for all packages
run: pnpm install
- name: Test ${{ matrix.packages.name }}
working-directory: ${{ matrix.packages.directory }}
run: ${{ matrix.packages.run }}
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install wasm-pack
uses: jetli/[email protected]
- name: Cache WASM build
uses: actions/cache@v3
with:
path: packages/create-web/template/rust_backend/target
key: rust_backend
- name: Build template for publishing
working-directory: packages/create-web/template/web
run: |
pnpm install
pnpm rust
pnpm python
BASE_PATH=/web-app-template pnpm build
# Unclear why this is necessary
cp -Rv build/assets/ build/_app/immutable/workers/
- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: packages/create-web/template/web/build