chore(CI): fix and simplify caching (#1571)
This commit is contained in:
+16
-29
@@ -16,6 +16,13 @@ jobs:
|
||||
matrix:
|
||||
deno: ["v1.x", "canary"]
|
||||
os: [macOS-latest, windows-latest, ubuntu-latest]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
cache_path: ~/.cache/deno/
|
||||
- os: macos-latest
|
||||
cache_path: ~/Library/Caches/deno/
|
||||
- os: windows-latest
|
||||
cache_path: ~\AppData\Local\deno\
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -36,36 +43,13 @@ jobs:
|
||||
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'canary'
|
||||
uses: crate-ci/typos@master
|
||||
|
||||
- name: Type check project
|
||||
run: deno task check:types
|
||||
|
||||
- name: Cache dependencies
|
||||
if: startsWith(matrix.os, 'ubuntu') && matrix.deno == 'v1.x'
|
||||
run: deno cache --config=www/deno.json src/dev/deps.ts src/server/deps.ts www/main.ts
|
||||
|
||||
- name: Cache Chrome (Linux)
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
- name: Cache dependencies and Chrome
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/deno/deno_puppeteer
|
||||
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
|
||||
restore-keys: chrome-1022525-${{ runner.os }}-
|
||||
|
||||
- name: Cache Chrome (macOS)
|
||||
if: startsWith(matrix.os, 'mac')
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/Library/Caches/deno/deno_puppeteer
|
||||
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
|
||||
restore-keys: chrome-1022525-${{ runner.os }}-
|
||||
|
||||
- name: Cache Chrome (Windows)
|
||||
if: startsWith(matrix.os, 'win')
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "C:\\Users\\RUNNER~1\\AppData\\Local\\deno\\deno_puppeteer"
|
||||
key: chrome-1022525-${{ runner.os }}-${{ hashFiles('tests/deps.ts') }}
|
||||
restore-keys: chrome-1022525-${{ runner.os }}-
|
||||
path: |
|
||||
${{ matrix.cache_path }}deps
|
||||
${{ matrix.cache_path }}deno_puppeteer
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/*deps.ts', 'tests/fixture_twind_hydrate/twind.config.ts') }}
|
||||
|
||||
- name: Install Chromium (Unix)
|
||||
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'mac')
|
||||
@@ -75,6 +59,9 @@ jobs:
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
run: set "PUPPETEER_PRODUCT=chrome" && deno run -A --unstable https://deno.land/x/puppeteer@16.2.0/install.ts
|
||||
|
||||
- name: Type check project
|
||||
run: deno task check:types
|
||||
|
||||
- name: Run tests
|
||||
run: deno test -A
|
||||
|
||||
@@ -87,4 +74,4 @@ jobs:
|
||||
|
||||
- name: Type check demo
|
||||
run: deno check --remote main.ts dev.ts
|
||||
working-directory: demo
|
||||
working-directory: demo
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { stringify, virtual } from "https://esm.sh/@twind/core@1.1.3";
|
||||
import { stringify, virtual } from "./twindv1_deps.ts";
|
||||
import { Plugin } from "../server.ts";
|
||||
|
||||
import { Options, setup, STYLE_ELEMENT_ID } from "./twindv1/shared.ts";
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
cssom,
|
||||
getSheet,
|
||||
setup,
|
||||
TwindConfig,
|
||||
} from "https://esm.sh/@twind/core@1.1.3";
|
||||
import { cssom, getSheet, setup, TwindConfig } from "../twindv1_deps.ts";
|
||||
import { STYLE_ELEMENT_ID } from "./shared.ts";
|
||||
|
||||
export default function hydrate(options: TwindConfig) {
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { JSX, options as preactOptions, VNode } from "preact";
|
||||
import {
|
||||
setup as twSetup,
|
||||
Sheet,
|
||||
tw,
|
||||
TwindConfig,
|
||||
} from "https://esm.sh/@twind/core@1.1.3";
|
||||
import { setup as twSetup, Sheet, tw, TwindConfig } from "../twindv1_deps.ts";
|
||||
|
||||
type PreactOptions = typeof preactOptions & { __b?: (vnode: VNode) => void };
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from "https://esm.sh/@twind/core@1.1.3";
|
||||
+2
-4
@@ -1,12 +1,10 @@
|
||||
import * as path from "$std/path/mod.ts";
|
||||
import {
|
||||
assertMatch,
|
||||
assertNotMatch,
|
||||
} from "https://deno.land/std@0.193.0/testing/asserts.ts";
|
||||
import { Status } from "../src/server/deps.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
assertMatch,
|
||||
assertNotMatch,
|
||||
assertStringIncludes,
|
||||
delay,
|
||||
puppeteer,
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
export {
|
||||
assert,
|
||||
assertEquals,
|
||||
assertMatch,
|
||||
assertNotMatch,
|
||||
assertStringIncludes,
|
||||
} from "https://deno.land/std@0.193.0/testing/asserts.ts";
|
||||
export { assertSnapshot } from "https://deno.land/std@0.193.0/testing/snapshot.ts";
|
||||
@@ -25,3 +27,5 @@ export {
|
||||
HTMLElement,
|
||||
HTMLMetaElement,
|
||||
} from "https://esm.sh/linkedom@0.15.1";
|
||||
export { defineConfig, type Preset } from "https://esm.sh/@twind/core@1.1.3";
|
||||
export { default as presetTailwind } from "https://esm.sh/@twind/preset-tailwind@1.1.4";
|
||||
|
||||
+1
-1
@@ -2,6 +2,7 @@ import { ServerContext, Status } from "../server.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
assertMatch,
|
||||
assertStringIncludes,
|
||||
delay,
|
||||
puppeteer,
|
||||
@@ -16,7 +17,6 @@ import {
|
||||
waitForText,
|
||||
withPageName,
|
||||
} from "./test_utils.ts";
|
||||
import { assertMatch } from "https://deno.land/std@0.193.0/testing/asserts.ts";
|
||||
|
||||
const ctx = await ServerContext.fromManifest(manifest, options);
|
||||
const handler = ctx.handler();
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
import { assertEquals } from "https://deno.land/std@0.190.0/testing/asserts.ts";
|
||||
import { assert, delay, puppeteer } from "./deps.ts";
|
||||
import { assert, assertEquals, delay, puppeteer } from "./deps.ts";
|
||||
|
||||
import { cmpStringArray } from "./fixture_twind_hydrate/utils/utils.ts";
|
||||
import { startFreshServer, withPageName } from "./test_utils.ts";
|
||||
|
||||
Reference in New Issue
Block a user