chore(ci): use github actions for windows (#7786)

This commit is contained in:
pooya parsa 2020-08-26 11:17:29 +00:00 committed by GitHub
parent 81a695669e
commit 9cb8a65e8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 154 additions and 40 deletions

152
.github/workflows/windows.yml vendored Normal file
View File

@ -0,0 +1,152 @@
name: windows
on:
push:
branches:
- dev
- 2.x
pull_request:
branches:
- dev
- 2.x
jobs:
setup:
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' || !((github.base_ref == '2.x') && github.head_ref == 'dev')
strategy:
matrix:
os: [windows-latest]
node: [12]
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: checkout
uses: actions/checkout@v2
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v1
with:
path: node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
- name: install
run: yarn --check-files --frozen-lockfile --non-interactive
- name: cache workspace
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
# TODO: Investigate [error]Process completed with exit code 1.
# test-unit:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [windows-latest]
# node: [12]
# env:
# NODE_OPTIONS: "--max_old_space_size=4096"
# steps:
# - uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node }}
# - name: checkout
# uses: actions/checkout@master
# - name: restore workspace cache
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}
# key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
# - name: test unit
# run: node node_modules/jest/bin/jest packages -i --coverage --verbose
# - name: codecov
# uses: codecov/codecov-action@v1
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# flags: unittests
# needs: setup
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
node: [12]
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: build
run: yarn test:fixtures -i
- name: cache fixtures
uses: actions/cache@v1
with:
path: test/fixtures
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
needs: setup
test-dev:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
node: [12]
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: checkout
uses: actions/checkout@master
- name: restore workspace cache
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-nuxt-${{ github.sha }}
- name: restore fixtures
uses: actions/cache@v1
with:
path: test/fixtures
key: ${{ matrix.os }}-node-v${{ matrix.node }}-fixtures-${{ github.sha }}
- name: test dev
run: yarn test:dev -i
needs: build

View File

@ -1,7 +1,7 @@
<p align="center"><img align="center" style="width:320px" src="https://nuxtjs.org/meta_400.png"/></p><br/>
<p align="center">
<a href="https://github.com/nuxt/nuxt.js/actions?query=branch%3Adev+event%3Apush"><img src="https://github.com/nuxt/nuxt.js/workflows/test/badge.svg?branch=dev&event=push" alt="Tests Status"></a>
<a href="https://dev.azure.com/nuxt/nuxt.js/_build/latest?definitionId=1"><img src="https://dev.azure.com/nuxt/nuxt.js/_apis/build/status/nuxt.js" alt="Azure Build Status"></a>
<a href="https://github.com/nuxt/nuxt.js/actions?query=branch%3Adev+event%3Apush"><img src="https://github.com/nuxt/nuxt.js/workflows/windows/badge.svg?branch=dev&event=push" alt="Windows Status"></a>
 <a href="https://codecov.io/gh/nuxt/nuxt.js"><img src="https://badgen.net/codecov/c/github/nuxt/nuxt.js/master" alt="Coverage Status"></a>
<a href="https://www.npmjs.com/package/nuxt"><img src="https://badgen.net/npm/dm/nuxt" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/nuxt"><img src="https://badgen.net/npm/v/nuxt" alt="Version"></a>

View File

@ -1,38 +0,0 @@
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
pool:
vmImage: 'vs2017-win2016'
trigger:
- dev
steps:
- task: NodeTool@0
inputs:
versionSpec: '^10.10.0'
displayName: 'Install Node.js'
- script: |
yarn --frozen-lockfile --non-interactive
displayName: 'Install dependencies'
- script: |
set JEST_JUNIT_OUTPUT_NAME=fixtures.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:fixtures -i
displayName: 'Test: Build Fixtures'
- script: |
set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:dev -w2
displayName: 'Test: Run dev tests'
- script: |
set JEST_JUNIT_OUTPUT_NAME=unit.xml && set NODE_OPTIONS=--max_old_space_size=4096 && yarn test:unit
displayName: 'Test: Run unit tests'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'reports/junit/*'
displayName: 'Publish test results to Azure Pipelines'

View File

@ -1,7 +1,7 @@
<p align="center"><img align="center" style="width:320px" src="https://nuxtjs.org/meta_400.png"/></p><br/>
<p align="center">
<a href="https://github.com/nuxt/nuxt.js/actions?query=branch%3Adev+event%3Apush"><img src="https://github.com/nuxt/nuxt.js/workflows/test/badge.svg?branch=dev&event=push" alt="Tests Status"></a>
<a href="https://dev.azure.com/nuxt/nuxt.js/_build/latest?definitionId=1"><img src="https://dev.azure.com/nuxt/nuxt.js/_apis/build/status/nuxt.js" alt="Azure Build Status"></a>
<a href="https://github.com/nuxt/nuxt.js/actions?query=branch%3Adev+event%3Apush"><img src="https://github.com/nuxt/nuxt.js/workflows/test-windows/badge.svg?branch=dev&event=push" alt="Windows Status"></a>
 <a href="https://codecov.io/gh/nuxt/nuxt.js"><img src="https://badgen.net/codecov/c/github/nuxt/nuxt.js/master" alt="Coverage Status"></a>
<a href="https://www.npmjs.com/package/nuxt"><img src="https://badgen.net/npm/dm/nuxt" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/nuxt"><img src="https://badgen.net/npm/v/nuxt" alt="Version"></a>