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