Skip to content

Commit

Permalink
[v1] chore: update CI to use pnpm (#103)
Browse files Browse the repository at this point in the history
* chore: update ci to use pnpm

* chore(lint): Prettier fix

---------

Co-authored-by: Michael Stramel <michael.stramel@koyfin.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 6, 2023
1 parent 4c69f26 commit 0725cd1
Show file tree
Hide file tree
Showing 5 changed files with 4,883 additions and 2,557 deletions.
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

0 comments on commit 0725cd1

Please sign in to comment.