Skip to content

Commit

Permalink
feat: Add CI tests
Browse files Browse the repository at this point in the history
Signed-off-by: Cerallin <cerallin@cerallin.top>
  • Loading branch information
Cerallin committed Apr 1, 2024
1 parent e68de7d commit 152e4e9
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: themes/hexo-theme-yuzu

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install node modules
run: |
npm ci
npm i hexo-renderer-pug
- name: Modify _config.yml
run: cat themes/hexo-theme-yuzu/_root_config_example.yml >> _config.yml

- name: Build assets
run: npm run build
41 changes: 41 additions & 0 deletions _root_config_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
since_year: 2020

post_copy:
text: 署名-非商业性使用-相同方式共享
text_en: CC BY-NC-SA 2.5 CN
link: https://creativecommons.org/licenses/by-nc-sa/2.5/cn/

# 自定义侧边栏
menu:
Archives:
widget: Archives # 三种:Archives | Posts | Tags
Posts1:
name: Posts
widget: Posts
Posts2:
name: Posts2
widget: Posts
Tags:
widget: Tags

# 右上角
header_menu:
关于: /about

# 备案
beian:
enable: true
icp: 京ICP备xxxxxxxx号

# visit count
visit_count:
type: busuanzi

# hexo-generator-search
# Please see https://github.com/wzpan/hexo-generator-search/tree/master for detail.
search:
path: meta.json # changeable
field: post
content: false # currently unsupported

theme: hexo-theme-yuzu

0 comments on commit 152e4e9

Please sign in to comment.