mirror of
https://github.com/rharkor/caching-for-turbo.git
synced 2025-06-08 01:37:01 +09:00
149 lines
3.3 KiB
YAML
149 lines
3.3 KiB
YAML
name: Test core functionality
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- dev
|
|
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-typescript:
|
|
name: TypeScript Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
id: checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
id: setup-node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: npm
|
|
|
|
- name: Install Dependencies
|
|
id: npm-ci
|
|
run: npm ci
|
|
|
|
- name: Check Format
|
|
id: npm-format-check
|
|
run: npm run format:check
|
|
|
|
- name: Lint
|
|
id: npm-lint
|
|
run: npm run lint
|
|
|
|
test-action:
|
|
name: GitHub Actions Test (Linux)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
id: checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
id: setup-node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: npm
|
|
|
|
- name: Install Dependencies
|
|
id: npm-ci
|
|
run: npm ci
|
|
|
|
- name: Test Local Action
|
|
uses: ./
|
|
with:
|
|
# Use a unique cache prefix for each pipeline & job
|
|
cache-prefix:
|
|
${{ runner.os }}-${{ github.run_id }}-${{ github.run_number }}-${{
|
|
runner.os }}
|
|
|
|
- name: Test build cache
|
|
run: npm run test
|
|
|
|
- name: Test build cache (full cache)
|
|
run: ./check-full-turbo.sh
|
|
|
|
test-action-windows:
|
|
name: GitHub Actions Test (Windows)
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
id: checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
id: setup-node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: npm
|
|
|
|
- name: Install Dependencies
|
|
id: npm-ci
|
|
run: npm ci
|
|
|
|
- name: Test Local Action
|
|
uses: ./
|
|
with:
|
|
# Use a unique cache prefix for each pipeline & job
|
|
cache-prefix:
|
|
${{ runner.os }}-${{ github.run_id }}-${{ github.run_number }}-${{
|
|
runner.os }}
|
|
|
|
- name: Test build cache
|
|
run: npm run test
|
|
|
|
- name: Test build cache (full cache)
|
|
run: ./check-full-turbo.sh
|
|
|
|
test-action-s3:
|
|
name: GitHub Actions Test (S3)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
id: checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
id: setup-node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: npm
|
|
|
|
- name: Install Dependencies
|
|
id: npm-ci
|
|
run: npm ci
|
|
|
|
- name: Test Local Action
|
|
uses: ./
|
|
with:
|
|
# Use a unique cache prefix for each pipeline & job
|
|
cache-prefix:
|
|
${{ runner.os }}-${{ github.run_id }}-${{ github.run_number }}-${{
|
|
runner.os }}
|
|
provider: s3
|
|
s3-access-key-id: ${{ secrets.S3_ACCESS_KEY_ID }}
|
|
s3-secret-access-key: ${{ secrets.S3_SECRET_ACCESS_KEY }}
|
|
s3-bucket: ${{ secrets.S3_BUCKET }}
|
|
s3-region: ${{ secrets.S3_REGION }}
|
|
s3-endpoint: ${{ secrets.S3_ENDPOINT }}
|
|
|
|
- name: Test build cache
|
|
run: npm run test
|
|
|
|
- name: Test build cache (full cache)
|
|
run: ./check-full-turbo.sh
|