Nuxt/.github/workflows/ci.yml

182 lines
3.7 KiB
YAML
Raw Normal View History

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Build
run: yarn build
- name: Cache dist
uses: actions/cache@v2
with:
path: packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}
lint:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Lint
run: yarn lint
- name: Lint (docs)
run: yarn lint:docs
test-fixtures:
runs-on: ${{ matrix.os }}
strategy:
matrix:
2021-08-09 18:24:52 +00:00
os: [ubuntu-latest, windows-latest]
node: [14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Stub
run: yarn stub
- name: Test (unit)
run: yarn test:unit
- name: Test (fixtures)
run: yarn test:fixtures
test-fixtures-webpack:
runs-on: ${{ matrix.os }}
strategy:
matrix:
2021-08-09 18:24:52 +00:00
os: [ubuntu-latest, windows-latest]
node: [14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Stub
run: yarn stub
- name: Test (fixtures)
run: yarn test:fixtures:webpack
test-types:
needs:
- build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Restore dist cache
uses: actions/cache@v2
with:
path: packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}
- name: Test (types)
run: yarn test:types
build-release:
needs:
- lint
- build
- test-fixtures
- test-fixtures-webpack
- test-types
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn --immutable
- name: Restore dist cache
uses: actions/cache@v2
with:
path: packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}
- name: Release Edge
if: |
github.event_name == 'push' &&
!contains(github.event.head_commit.message, '[skip-release]') &&
!contains(github.event.head_commit.message, 'chore') &&
!contains(github.event.head_commit.message, 'docs')
run: ./scripts/release-edge.sh
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}