From 81ce85a1e863c49dc29934d7ebb8f3b46f382a85 Mon Sep 17 00:00:00 2001 From: Yufan You Date: Wed, 5 Aug 2020 22:08:36 +0800 Subject: [PATCH] ci: check links (#54) * ci: check links * ci(check-link): set root directory * ci(check-link): fail on errors * ci(check-link): disable verbose * fix(contributing): fix link to build from source --- .github/workflows/build-test.yml | 50 ++++++++++--------- .../en/docs/Contribution guidelines/_index.md | 2 +- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0f769fdb7..e7af4c354 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,30 +1,34 @@ name: "Build Test" -on: - pull_request: - branches: - - hugo +on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Fetch submodules - run: git submodule update --init --recursive - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: '13.x' - - run: npm install - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: '0.69.2' - extended: true - - name: Build Site - run: | - git config --global core.quotePath false - HUGO_ENV=production hugo --minify + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Fetch submodules + run: git submodule update --init --recursive + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: "13.x" + - run: npm install + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: "0.69.2" + extended: true + - name: Build Site + run: | + git config --global core.quotePath false + HUGO_ENV=production hugo --minify + - name: Check links + id: check-links + uses: peter-evans/link-checker@v1 + with: + args: -r public -d public + - name: Fail on link errors + run: exit ${{ steps.check-links.outputs.exit_code }} diff --git a/content/en/docs/Contribution guidelines/_index.md b/content/en/docs/Contribution guidelines/_index.md index 5e0cc308f..c29025c4c 100644 --- a/content/en/docs/Contribution guidelines/_index.md +++ b/content/en/docs/Contribution guidelines/_index.md @@ -24,7 +24,7 @@ You are here to help CP Editor? Awesome, feel free and read the following sectio **First time to developing?** There's a big difference between developing and competitive programming, but it's not hard. The first thing you should know is Object-Oriented Programming. Basically, you need to know how classes work in C++, and you should know it's a rule to put the class definitions in the `.hpp` files, and put the implementation of the functions in the `.cpp` files. The source code of the CP Editor is a good example. Google for what you want to implement is usually helpful. Copy and modify the source codes if you want to implement something similar to an existing feature. If you are looking for an IDE for developing, [VS Code](https://code.visualstudio.com/) is probably a good choice. -**First time to Qt?** Don't be afraid, Qt is not hard to get started. You have to install Qt>=5.14 and CMake>=3.5 first. Linux users may install them using the package manager on your system. Windows users may download Qt [here](https://www.qt.io/offline-installers) and it's recommended to use [Visual Studio](https://visualstudio.microsoft.com/) and install the CMake plugin. Read the [build from source](doc/INSTALL.md#Build-from-source) section to learn how to build. Read the [Qt docs](https://doc.qt.io/) on how to use Qt built-in widgets, how to design the UI and how to use the [signals and slots](https://doc.qt.io/qt-5/signalsandslots.html). Usually, you don't need anything from the std namespace, for example, use `QString` instead of `std::string`. +**First time to Qt?** Don't be afraid, Qt is not hard to get started. You have to install Qt>=5.14 and CMake>=3.5 first. Linux users may install them using the package manager on your system. Windows users may download Qt [here](https://www.qt.io/offline-installers) and it's recommended to use [Visual Studio](https://visualstudio.microsoft.com/) and install the CMake plugin. Read the [build from source](../installation/build-from-source) section to learn how to build. Read the [Qt docs](https://doc.qt.io/) on how to use Qt built-in widgets, how to design the UI and how to use the [signals and slots](https://doc.qt.io/qt-5/signalsandslots.html). Usually, you don't need anything from the std namespace, for example, use `QString` instead of `std::string`. **Don't know where to start?** You can start by looking through the [issues](https://github.com/cpeditor/cpeditor/issues) and find one you are interested in. The [good first issues](https://github.com/cpeditor/cpeditor/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) may be suitable for you. Ask in the [Telegram group](https://t.me/cpeditor) or under the issues if you have any questions.