diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e6dbc6f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: + push: + branches: + - "master" + pull_request: + +env: + default_node_version: 14 + +jobs: + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node-version: ["14", "16", "18"] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js ${{ matrix.node-version }} and Cache + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: "package.json" + + - name: Install Dependencies + run: npm install + - name: git-config + run: git config --global user.email "you@example.com" && git config --global user.name "Your Name" + - name: Test + run: npm run test -- --no-parallel + + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js ${{env.default_node_version}} and Cache + uses: actions/setup-node@v4 + with: + node-version: ${{env.default_node_version}} + cache: npm + cache-dependency-path: "package.json" + + - name: Install Dependencies + run: npm install + - name: git-config + run: git config --global user.email "you@example.com" && git config --global user.name "Your Name" + - name: Coverage + run: npm run test-cov + - name: Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.github_token }} + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js ${{env.default_node_version}} and Cache + uses: actions/setup-node@v4 + with: + node-version: ${{env.default_node_version}} + cache: npm + cache-dependency-path: "package.json" + + - name: Install Dependencies + run: npm install + - name: Lint + run: npm run eslint diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml deleted file mode 100644 index 6e3f98a..0000000 --- a/.github/workflows/tester.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Tester - -on: [push, pull_request] - -jobs: - tester: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [14, 16, 18] - fail-fast: false - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - name: Install Dependencies - run: npm install - - name: git-config - run: git config --global user.email "you@example.com" && git config --global user.name "Your Name" - - name: Test - run: npm test -- --no-parallel - env: - CI: true - coverage: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - node-version: [14] - steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - name: Install Dependencies - run: npm install - - name: git-config - run: git config --global user.email "you@example.com" && git config --global user.name "Your Name" - - name: Coverage - run: npm run test-cov - env: - CI: true - - name: Coveralls - uses: coverallsapp/github-action@v2 - with: - github-token: ${{ secrets.github_token }} diff --git a/README.md b/README.md index dd22911..cb75ceb 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ # hexo-deployer-git -[![Build Status](https://github.com/hexojs/hexo-deployer-git/workflows/Tester/badge.svg)](https://github.com/hexojs/hexo-deployer-git/actions?query=workflow%3ATester) +[![CI](https://github.com/hexojs/hexo-deployer-git/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/hexojs/hexo-deployer-git/actions/workflows/ci.yml) [![NPM version](https://badge.fury.io/js/hexo-deployer-git.svg)](https://www.npmjs.com/package/hexo-deployer-git) -[![Coverage Status](https://img.shields.io/coveralls/hexojs/hexo-deployer-git.svg)](https://coveralls.io/r/hexojs/hexo-deployer-git?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/hexojs/hexo-deployer-git/badge.svg)](https://coveralls.io/github/hexojs/hexo-deployer-git) Git deployer plugin for [Hexo]. ## Notice: Fatal HttpRequestException Error on pushing to GitHub? + Update [Git for Windows](https://github.com/git-for-windows/git/releases) to the latest version. ([Details](https://github.com/Microsoft/Git-Credential-Manager-for-Windows#notice-experiencing-github-pushfetch-problems)) ## Installation @@ -119,6 +120,7 @@ If `.deploy_git` does not exist, a repo will initialized (`git init`). Otherwise the curent repo (with its commit history) will be used. Users can clone the deployed repo to `.deploy_git` to keep the commit history. + ``` git clone .deploy_git ```