Skip to content

Commit

Permalink
skip astro compress integration on test CI (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
outofambit authored Apr 11, 2024
1 parent d2c682f commit 172416d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Lint
- name: Test
run: npm run test
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -43,5 +43,6 @@ jobs:
run: npm ci
- name: Build
env:
SKIP_BUILD_COMPRESS: 1
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run build
12 changes: 11 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ import mdx from "@astrojs/mdx";
import compress from "astro-compress";
import tailwind from "@astrojs/tailwind";

// Allow skipping compression step for faster test build times
// DO NOT SKIP COMPRESSION FOR DEPLOYMENT!
const shouldSkipCompress = Boolean(
process.env.SKIP_BUILD_COMPRESS && process.env.SKIP_BUILD_COMPRESS.length > 0,
);

if (shouldSkipCompress) {
console.log("WILL SKIP COMPRESS BUILD STEP");
}

// https://astro.build/config
export default defineConfig({
integrations: [
Expand All @@ -12,7 +22,7 @@ export default defineConfig({
}),
mdx(),
tailwind(),
compress(),
shouldSkipCompress ? null : compress(),
],
trailingSlash: "ignore",
build: {
Expand Down

0 comments on commit 172416d

Please sign in to comment.