Skip to content

Commit

Permalink
feat: add github actions ci
Browse files Browse the repository at this point in the history
  • Loading branch information
flyfishzy committed Aug 10, 2021
1 parent 780d8c8 commit 85d1457
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: 🚨 Bug report | Bug 提交
about: Report a bug report to help us improve.
title: ''
labels: 'bug-report'
assignees: ''

---

<!-- 💚 Thanks for your time to make us better with your feedbacks 💚
👍 A properly detailed bug report can save a LOT of time and help fixing issues as soon as possible.
-->

### Versions

- originjs: <!-- ex: v0.1.0 -->
- node: <!-- ex: v12.14.0 -->

### Reproduction

<!--
Link to a minimal test case based on one of:
- A GitHub repository that can reproduce the bug
Without a reproduction, it is so hard to address problem :(
-->

<details open>
<summary>Additional Details</summary>
<br>
<!-- Attaching `config`, dependencies, logs or code snippets would help to find the issue -->
</details>

### Steps to reproduce


### What is Expected?


### What is actually happening?
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
blank_issues_enabled: false
contact_links:
- name: ❗️ All other issues | 其他问题
url: https://github.com/originjs/origin.js/discussions
about: |
Please use GitHub Discussions for other issues and asking questions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: 🙋 Feature request | 新功能提案
about: Suggest an idea or enhancement.
title: ''
labels: 'feature-request'
assignees: ''

---

<!-- 💚 Thanks for your time to make us better with your feedbacks 💚 -->

### Is your feature request related to a problem? Please describe.

<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

### Describe the solution you'd like

<!-- A clear and concise description of what you want to happen. Adding some code examples would be neat! -->

### Describe alternatives you've considered

<!-- A clear and concise description of any alternative solutions or features you've considered. -->

### Additional context

<!-- Add any other context or screenshots about the feature request here. -->
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push:
branches:
- '**'
pull_request:
branches:
- main

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node_version: [12, 14, 16]
include:
- os: macos-latest
node_version: 14
- os: windows-latest
node_version: 14
fail-fast: false

name: "Build&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: Versions
run: yarn versions

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Test
run: yarn test

27 changes: 27 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: nightly

on:
schedule:
- cron: '0 0 * * *'

jobs:
nightly:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'refs/heads/main'
fetch-depth: 0 # All history
- name: fetch tags
run: git fetch --depth=1 origin "+refs/tags/*:refs/tags/*"
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: install
run: yarn --check-files --frozen-lockfile --non-interactive
- name: build
run: PACKAGE_SUFFIX=edge yarn build
- name: test
run: yarn test

0 comments on commit 85d1457

Please sign in to comment.