mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
ci: create install-node-dependencies action (#100)
This commit is contained in:
committed by
GitHub
parent
65faaf0183
commit
6d72ffb876
@@ -0,0 +1,37 @@
|
|||||||
|
name: Install NodeJS Dependencies
|
||||||
|
description: This is a composite GitHub Action that sets up pnpm, node and installs the project's dependencies.
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
node-version:
|
||||||
|
description: 'Explicit node version. Otherwise fallback reading `.nvmrc`. Use in conjunction with matrix'
|
||||||
|
required: false
|
||||||
|
registry-url:
|
||||||
|
description: 'https://github.com/actions/setup-node?tab=readme-ov-file#usage'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js (via input)
|
||||||
|
if: ${{ inputs.node-version }}
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: ${{ inputs.node-version }}
|
||||||
|
registry-url: ${{ inputs.registry-url }}
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Setup Node.js (via .nvmrc)
|
||||||
|
if: ${{ !inputs.node-version }}
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
registry-url: ${{ inputs.registry-url }}
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
shell: bash
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
@@ -13,19 +13,16 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
|
name: Check build documentation
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Install NodeJS Dependencies
|
||||||
uses: actions/setup-node@v4
|
uses: ./.github/actions/install-node-dependencies
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
|
|
||||||
- name: Setup rust
|
- name: Setup rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
@@ -33,32 +30,22 @@ jobs:
|
|||||||
- name: Install tuono
|
- name: Install tuono
|
||||||
run: cargo install tuono@0.12.3
|
run: cargo install tuono@0.12.3
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
run: npm i -g pnpm
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
working-directory: ./apps/documentation
|
working-directory: ./apps/documentation
|
||||||
run: tuono build --static
|
run: tuono build --static
|
||||||
|
|
||||||
fmt-lint-and-types:
|
fmt-lint-and-types:
|
||||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
|
name: Check format and lint typescript
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install NodeJS Dependencies
|
||||||
run: npm i -g pnpm
|
uses: ./.github/actions/install-node-dependencies
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: pnpm docs:format:check
|
run: pnpm docs:format:check
|
||||||
|
|||||||
@@ -15,15 +15,11 @@ jobs:
|
|||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Install NodeJS Dependencies
|
||||||
uses: actions/setup-node@v4
|
uses: ./.github/actions/install-node-dependencies
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
|
|
||||||
- name: Setup rust
|
- name: Setup rust
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
@@ -31,12 +27,6 @@ jobs:
|
|||||||
- name: Install tuono
|
- name: Install tuono
|
||||||
run: cargo install tuono@0.12.3
|
run: cargo install tuono@0.12.3
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
run: npm i -g pnpm
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
working-directory: ./apps/documentation
|
working-directory: ./apps/documentation
|
||||||
run: tuono build --static
|
run: tuono build --static
|
||||||
|
|||||||
@@ -7,24 +7,14 @@ jobs:
|
|||||||
publish-on-npm-dry-run:
|
publish-on-npm-dry-run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install NodeJS Dependencies
|
||||||
uses: actions/setup-node@v4
|
uses: ./.github/actions/install-node-dependencies
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v3
|
|
||||||
name: Install pnpm
|
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
run_install: false
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|
||||||
@@ -36,11 +26,14 @@ jobs:
|
|||||||
publish-on-crates-dry-run:
|
publish-on-crates-dry-run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- uses: katyo/publish-crates@v2
|
- uses: katyo/publish-crates@v2
|
||||||
with:
|
with:
|
||||||
path: './crates/tuono'
|
path: './crates/tuono'
|
||||||
@@ -52,27 +45,17 @@ jobs:
|
|||||||
needs: [publish-on-crates-dry-run, publish-on-npm-dry-run]
|
needs: [publish-on-crates-dry-run, publish-on-npm-dry-run]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install NodeJS Dependencies
|
||||||
uses: actions/setup-node@v4
|
uses: ./.github/actions/install-node-dependencies
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v3
|
|
||||||
name: Install pnpm
|
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
run_install: false
|
|
||||||
|
|
||||||
- name: Clone root README.md on tuono package
|
- name: Clone root README.md on tuono package
|
||||||
run: cp README.md packages/tuono/README.md
|
run: cp README.md packages/tuono/README.md
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
|
|
||||||
@@ -85,11 +68,14 @@ jobs:
|
|||||||
needs: [publish-on-crates-dry-run, publish-on-npm-dry-run]
|
needs: [publish-on-crates-dry-run, publish-on-npm-dry-run]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
- uses: katyo/publish-crates@v2
|
- uses: katyo/publish-crates@v2
|
||||||
with:
|
with:
|
||||||
path: './crates/tuono'
|
path: './crates/tuono'
|
||||||
|
|||||||
@@ -10,16 +10,19 @@ on:
|
|||||||
- '.github/**'
|
- '.github/**'
|
||||||
- 'crates/**'
|
- 'crates/**'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint_and_fmt:
|
lint_and_fmt:
|
||||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
|
name: Check format and lint rust crates
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- run: cargo fmt --all -- --check
|
- run: cargo fmt --all -- --check
|
||||||
- run: cargo clippy -- -D warnings
|
- run: cargo clippy -- -D warnings
|
||||||
|
|
||||||
@@ -34,7 +37,9 @@ jobs:
|
|||||||
- beta
|
- beta
|
||||||
- nightly
|
- nightly
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
|
||||||
- run: cargo build --verbose
|
- run: cargo build --verbose
|
||||||
- run: cargo test --verbose
|
- run: cargo test --verbose
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ jobs:
|
|||||||
name: runner / LanguageTools
|
name: runner / LanguageTools
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: reviewdog/action-languagetool@v1
|
- uses: reviewdog/action-languagetool@v1
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.REVIEWDOG_TOKEN }}
|
github_token: ${{ secrets.REVIEWDOG_TOKEN }}
|
||||||
|
|||||||
@@ -13,25 +13,16 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
|
name: Check build and test typescript
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Install NodeJS Dependencies
|
||||||
uses: actions/setup-node@v4
|
uses: ./.github/actions/install-node-dependencies
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
run: npm i -g pnpm
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: pnpm build
|
run: pnpm build
|
||||||
@@ -41,20 +32,16 @@ jobs:
|
|||||||
|
|
||||||
fmt-lint-and-types:
|
fmt-lint-and-types:
|
||||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
|
||||||
|
name: Check format and lint typescript
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install NodeJS Dependencies
|
||||||
run: npm i -g pnpm
|
uses: ./.github/actions/install-node-dependencies
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: pnpm format:check
|
run: pnpm format:check
|
||||||
|
|||||||
+3
-3
@@ -1,12 +1,12 @@
|
|||||||
|
## Node related ignores
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
.turbo/
|
.turbo/
|
||||||
|
|
||||||
*/**/routeTree.gen.ts
|
*/**/routeTree.gen.ts
|
||||||
|
|
||||||
pnpm-lock.yaml
|
examples/*/pnpm-lock.yaml
|
||||||
|
|
||||||
examples/playground/
|
|
||||||
|
|
||||||
## Rust related ignores
|
## Rust related ignores
|
||||||
|
|
||||||
|
|||||||
Generated
+7234
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user