From b8a13d93e909c735ed5ec46f4c075b4c56eb31f2 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Tue, 12 Nov 2019 13:45:04 +0900 Subject: [PATCH] chore: Add .github --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 23 +++++++ .github/PULL_REQUEST_TEMPLATE.md | 15 +++++ .github/workflows/ci.yml | 80 +++++++++++++++++++++++ README.md | 2 + makefile | 2 +- 6 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/ci.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..f2c9f7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "" +labels: bug +assignees: "" +--- + +## Describe the bug + +A clear and concise description of what the bug is. + +## Reproduced step + +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +## Expected behavior + +A clear and concise description of what you expected to happen. + +## Actual behavior + +A clear and concise description of what you actual to happen. + +## Screenshots + +If applicable, add screenshots to help explain your problem. + +## Desktop (please complete the following information) + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..6d0405a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "" +labels: "" +assignees: "" +--- + +## 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. + +## 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. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..0fb7a59 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,15 @@ +## What does this change? + +A clear and concise description of what the changes is. + +## References + +- If you have links to other resources, please list them here. (e.g. issue url, related pull request url, documents) + +## Screenshots + +If applicable, add screenshots to help explain your changes. + +## What can I check for bug fixes? + +Please briefly describe how you can confirm the resolution of the bug. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a80425c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,80 @@ +name: Continuous Integration +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions/setup-node@master + with: + node-version: 12 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - name: install deps + run: | + sudo add-apt-repository ppa:libreoffice/ppa + sudo apt-get update + sudo apt-get install libreoffice + npm i -g reg-cli + cd vrt && yarn --frozen-lockfile && cd ../ + - name: test + run: make test -B && make vrt -B + - uses: actions/upload-artifact@master + with: + name: vrt + path: vrt/screenshot + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Cache cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - run: cargo build +# clippy: +# name: Clippy +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v1 +# - uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: stable +# override: true +# - run: rustup component add clippy +# - uses: actions-rs/cargo@v1 +# with: +# command: clippy +# args: -- -D warnings diff --git a/README.md b/README.md index b736381..936ea23 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # docx-rs + +[![GitHub Actions Status](https://github.com/bokuweb/docx-rs/workflows/Continuous%20Integration/badge.svg)](https://github.com/bokuweb/docx-rs/actions) diff --git a/makefile b/makefile index b48caa3..2430124 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ test: cargo test vrt: - node vrt/index.js && reg-cli vrt/screenshot/actual vrt/screenshot/expected vrt/screenshot/diff -R vrt/report.html + node vrt/index.js && reg-cli vrt/screenshot/actual vrt/screenshot/expected vrt/screenshot/diff -R vrt/report.html -I vrt-update: node vrt/index.js && reg-cli vrt/screenshot/actual vrt/screenshot/expected vrt/screenshot/diff -R vrt/report.html -U \ No newline at end of file