Skip to content

Commit

Permalink
chore: add windows to validate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Jan 23, 2024
1 parent 08d9284 commit 425ac54
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 15 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Test Windows

on:
workflow_dispatch:
pull_request:
types:
- edited
- opened
- synchronize
push:
branches:
- '*'
- '!main'

jobs:
validate:
runs-on: windows-latest
name: Test

steps:
- name: Checkout Commit
uses: actions/checkout@v4
with:
fetch-depth: 10

# Needed for https://github.com/moonrepo/moon/issues/1060
- name: Force Update Main
run: |
git fetch origin
git branch -f main origin/main
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Enable Corepack
id: pnpm-setup
run: |
corepack enable
corepack prepare pnpm@latest --activate
pnpm config set script-shell "/usr/bin/bash"
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: pnpm Cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup Moon
uses: moonrepo/setup-toolchain@v0

- name: pnpm install
run: |
pnpm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
pnpm install --frozen-lockfile
shell: bash

- name: Build Projects
run: moon jsx-email:build

- name: Run Tests
run: moon run :test --affected --concurrency 1 --remote

- name: Run Preview Test
# Note: We're running `pnpm i` again so that pnpm places the `email` bin in root node_modules
# We'll need that for the preview tests below
run: |
pnpm i
moon app-test:playwright
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dist
.nojekyll
**/.vitepress/cache

packages/**/tsconfig.json
packages/jsx-email/README.md

test-results
Expand Down
15 changes: 8 additions & 7 deletions .moon/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fileGroups:

tasks:
clean.dist:
command: rm -rf dist
command: pnpm exec rm -rf dist
inputs:
- src
- package.json
Expand All @@ -25,9 +25,10 @@ tasks:
outputStyle: 'stream'
runDepsInParallel: false

tsconfig.link:
command: ln -sf ../../shared/tsconfig.default.json tsconfig.json
options:
cache: false
outputStyle: 'stream'
platform: system
# tsconfig.link:
# # command: ln -sf ../../shared/tsconfig.default.json tsconfig.json
# command: pnpm exec cp ../../shared/tsconfig.default.json tsconfig.json
# options:
# cache: false
# outputStyle: 'stream'
# platform: system
2 changes: 1 addition & 1 deletion packages/create-jsx-email/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tasks:
- starter
- src
deps:
- ~:tsconfig.link
# - ~:tsconfig.link
- ~:tsc
- ~:copy
options:
Expand Down
9 changes: 9 additions & 0 deletions packages/create-jsx-email/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"outDir": "dist",
"target": "ES2015"
},
"exclude": ["dist", "node_modules", "**/*.spec.tsx", "**/*.spec.ts"],
"extends": "../../shared/tsconfig.base.json",
"include": ["src"]
}
13 changes: 7 additions & 6 deletions packages/jsx-email/moon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ workspace:

tasks:
build:
command: rm -f tsconfig.json
# See https://github.com/moonrepo/moon/issues/1284 for why we have to prefix with pnpm exec
command: pnpm exec rm -f tsconfig.json
deps:
- ~:clean.dist
- ~:compile
Expand All @@ -22,7 +23,7 @@ tasks:
runDepsInParallel: false

clean.readme:
command: rm README.md
command: pnpm exec rm README.md
options:
cache: false

Expand All @@ -31,18 +32,18 @@ tasks:
inputs:
- src
- package.json
deps:
- ~:tsconfig.link
# deps:
# - ~:tsconfig.link
options:
runDepsInParallel: false

copy.assets:
command: cp -r src/cli/assets dist
command: pnpm exec cp -r src/cli/assets dist
options:
cache: false

copy.readme:
command: cp -r ../../README.md README.md
command: pnpm exec cp -r ../../README.md README.md
options:
cache: false

Expand Down

0 comments on commit 425ac54

Please sign in to comment.