From 85d1457ac38fbbed87ca2c95ede0731aa4c1b4df Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 10 Aug 2021 15:38:01 +0800 Subject: [PATCH] feat: add github actions ci --- .github/ISSUE_TEMPLATE/bug-report.md | 39 +++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 6 +++ .github/ISSUE_TEMPLATE/feature-request.md | 26 ++++++++++ .github/workflows/ci.yml | 59 +++++++++++++++++++++++ .github/workflows/nightly.yml | 27 +++++++++++ 5 files changed, 157 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.md create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/nightly.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..38fcf89 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,39 @@ +--- +name: ๐Ÿšจ Bug report | Bug ๆไบค +about: Report a bug report to help us improve. +title: '' +labels: 'bug-report' +assignees: '' + +--- + + + +### Versions + +- originjs: +- node: + +### Reproduction + + + +
+Additional Details +
+ +
+ +### Steps to reproduce + + +### What is Expected? + + +### What is actually happening? diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..055e957 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -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. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..acc28fe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,26 @@ +--- +name: ๐Ÿ™‹ Feature request | ๆ–ฐๅŠŸ่ƒฝๆๆกˆ +about: Suggest an idea or enhancement. +title: '' +labels: 'feature-request' +assignees: '' + +--- + + + +### Is your feature request related to a problem? Please describe. + + + +### Describe the solution you'd like + + + +### Describe alternatives you've considered + + + +### Additional context + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2d7108a --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 + diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..ef21b5d --- /dev/null +++ b/.github/workflows/nightly.yml @@ -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 +