Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1] chore: update CI to use pnpm #103

Merged
merged 2 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 46 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ defaults:

jobs:
# Lint can run in parallel with Build.
# We also run `yarn install` with the `--prefer-offline` flag to speed things up.
# Lint can run in parallel with Build.
# We also run `yarn install` with the `--prefer-offline` flag to speed things up.
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Check out repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v2
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
node-version: 16
cache: 'yarn'
version: 8

- name: Install NPM Dependencies
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines
env:
CI: true

- name: Status
run: git status
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

# Lint autofix cannot run on forks, so just skip those! See https://github.com/wearerequired/lint-action/issues/13
- name: Lint (External)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
run: yarn lint
run: pnpm run lint

# Otherwise, run lint autofixer
- name: Lint
Expand All @@ -69,21 +69,24 @@ jobs:
strategy:
matrix:
target: [demo]
node-version: [18]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check out repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v2
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
node-version: 16
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
version: 8

- name: Install NPM Dependencies
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
env:
CI: true
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: yarn build
Expand All @@ -96,22 +99,28 @@ jobs:
if: ${{ github.ref_name == 'main' }}
needs: [lint, smoke]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v2
- name: Check out repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v2
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install NPM Dependencies
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
env:
CI: true
- name: Install dependencies
run: pnpm install

- name: Create Release Pull Request or Publish
id: changesets
Expand Down
30 changes: 15 additions & 15 deletions demo/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { defineCollection, z } from 'astro:content';
import { defineCollection, z } from "astro:content";

const blog = defineCollection({
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),
description: z.string(),
// Transform string to Date object
pubDate: z
.string()
.or(z.date())
.transform((val) => new Date(val)),
updatedDate: z
.string()
.optional()
.transform((str) => (str ? new Date(str) : undefined)),
}),
// Type-check frontmatter using a schema
schema: z.object({
title: z.string(),
description: z.string(),
// Transform string to Date object
pubDate: z
.string()
.or(z.date())
.transform((val) => new Date(val)),
updatedDate: z
.string()
.optional()
.transform((str) => (str ? new Date(str) : undefined)),
}),
});

export const collections = { blog };
2 changes: 1 addition & 1 deletion packages/core/components.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as Icon } from './lib/Icon.astro'
export { default as Icon } from "./lib/Icon.astro";
4 changes: 2 additions & 2 deletions packages/core/integration.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AstroIntegration } from 'astro';
import { AstroIntegration } from "astro";

export interface AstroIconOptions {
include: Record<string, ['*'] | string[]>
include: Record<string, ["*"] | string[]>;
}

export type Icon = string;
Expand Down
Loading