Skip to content

Commit 172416d

Browse files
authored
skip astro compress integration on test CI (#197)
1 parent d2c682f commit 172416d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: actions/checkout@v4
1515
- name: Install dependencies
1616
run: npm ci
17-
- name: Lint
17+
- name: Test
1818
run: npm run test
1919
lint:
2020
runs-on: ubuntu-latest
@@ -43,5 +43,6 @@ jobs:
4343
run: npm ci
4444
- name: Build
4545
env:
46+
SKIP_BUILD_COMPRESS: 1
4647
NODE_OPTIONS: "--max_old_space_size=4096"
4748
run: npm run build

astro.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ import mdx from "@astrojs/mdx";
44
import compress from "astro-compress";
55
import tailwind from "@astrojs/tailwind";
66

7+
// Allow skipping compression step for faster test build times
8+
// DO NOT SKIP COMPRESSION FOR DEPLOYMENT!
9+
const shouldSkipCompress = Boolean(
10+
process.env.SKIP_BUILD_COMPRESS && process.env.SKIP_BUILD_COMPRESS.length > 0,
11+
);
12+
13+
if (shouldSkipCompress) {
14+
console.log("WILL SKIP COMPRESS BUILD STEP");
15+
}
16+
717
// https://astro.build/config
818
export default defineConfig({
919
integrations: [
@@ -12,7 +22,7 @@ export default defineConfig({
1222
}),
1323
mdx(),
1424
tailwind(),
15-
compress(),
25+
shouldSkipCompress ? null : compress(),
1626
],
1727
trailingSlash: "ignore",
1828
build: {

0 commit comments

Comments
 (0)