mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
107 lines
2.7 KiB
YAML
107 lines
2.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
paths-ignore:
|
|
- '.vscode/**'
|
|
- 'docs/**'
|
|
- 'examples/**'
|
|
- 'www/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
node_version: [12, 14, 16]
|
|
include:
|
|
- os: windows-latest
|
|
node_version: 14
|
|
fail-fast: false
|
|
|
|
name: 'Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set node version to ${{ matrix.node_version }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
- name: Get yarn cache directory
|
|
id: yarn-cache
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- name: Set dependencies cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.yarn-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }}
|
|
${{ runner.os }}-${{ matrix.node_version }}-
|
|
|
|
- name: Debug
|
|
run: yarn versions
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile --ignore-engines
|
|
|
|
- name: Build Astro
|
|
run: yarn build:all
|
|
|
|
- name: Test
|
|
run: yarn test
|
|
|
|
- name: "Smoke Test: Build 'docs'"
|
|
run: yarn build
|
|
working-directory: ./docs
|
|
|
|
- name: "Smoke Test: Build 'www'"
|
|
run: yarn build
|
|
working-directory: ./www
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
name: 'Lint: node-14, ubuntu-latest'
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set node version to 14
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 14
|
|
|
|
- name: Get yarn cache directory
|
|
id: yarn-cache
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
- name: Set dependencies cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.yarn-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }}
|
|
${{ runner.os }}-${{ matrix.node_version }}-
|
|
|
|
- name: Debug
|
|
run: yarn versions
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile --ignore-engines
|
|
|
|
- name: Build
|
|
run: yarn build:all
|
|
|
|
- name: Lint
|
|
run: yarn lint
|
|
# linting is currently not passing, so just do this for inline for now
|
|
continue-on-error: true
|