Move the CI to Github Actions.
This commit is contained in:
parent
47a32fcce3
commit
c30bfd5649
5 changed files with 88 additions and 25 deletions
81
.github/workflows/ci.yml
vendored
Normal file
81
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
name: build
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- 'docs/**'
|
||||||
|
- 'README.md'
|
||||||
|
- 'LICENSE'
|
||||||
|
- '.travis.yml'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.6
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v1
|
||||||
|
with:
|
||||||
|
python-version: 3.7.6
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Bundle Caching
|
||||||
|
id: bundle-cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: vendor/bundle
|
||||||
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gems-
|
||||||
|
|
||||||
|
- name: Pip caching
|
||||||
|
id: pip-cache
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
# the path from: pip show pip | grep Location
|
||||||
|
path: ${{ runner.tool_cache }}/Python/3.7.6/x64/lib/python3.7/site-packages
|
||||||
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
|
- name: Install gnu-coreutils for macOS
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
brew install coreutils
|
||||||
|
|
||||||
|
- name: Bundle config
|
||||||
|
run: |
|
||||||
|
bundle config path vendor/bundle
|
||||||
|
|
||||||
|
- name: Bundle Install
|
||||||
|
if: steps.bundle-cache.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
bundle install
|
||||||
|
|
||||||
|
- name: Bundle Install locally
|
||||||
|
if: steps.bundle-cache.outputs.cache-hit == 'true'
|
||||||
|
run: |
|
||||||
|
bundle install --local
|
||||||
|
|
||||||
|
- name: Pip installing
|
||||||
|
if: steps.pip-cache.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
pip install -r _scripts/py/requirements.txt
|
||||||
|
|
||||||
|
- name: Build Site
|
||||||
|
run: |
|
||||||
|
bash tools/build.sh
|
||||||
|
|
||||||
|
- name: Test Site
|
||||||
|
run: |
|
||||||
|
bash tools/test.sh
|
|
@ -17,7 +17,11 @@ addons:
|
||||||
- libcurl4-openssl-dev # required to avoid SSL error (for htmlproofer)
|
- libcurl4-openssl-dev # required to avoid SSL error (for htmlproofer)
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- bash _scripts/travis/cibuild.sh
|
- >-
|
||||||
|
git clone https://${GH_PAT}@github.com/${GH_USER}/${BUILDER_REPO}.git
|
||||||
|
${HOME}/${BUILDER_REPO} --depth=1 -q
|
||||||
|
- cp -r ${HOME}/${BUILDER_REPO}/framework/* .
|
||||||
|
- bash _cibuild.sh
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: master
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Jekyll Theme Chirpy
|
# Jekyll Theme Chirpy
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.com/cotes2020/jekyll-theme-chirpy.svg?branch=master)](https://travis-ci.com/cotes2020/jekyll-theme-chirpy)
|
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=event%3Apush)
|
||||||
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||||
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
|
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
|
||||||
|
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Travis CI build jobs.
|
|
||||||
# v2.0
|
|
||||||
# https://github.com/cotes2020/jekyll-theme-chirpy
|
|
||||||
# © 2019 Cotes Chung
|
|
||||||
# Published under MIT License
|
|
||||||
|
|
||||||
if [[ $TRAVIS_PULL_REQUEST = "false" ]]; then # triggered by author
|
|
||||||
|
|
||||||
git clone https://${GH_PAT}@github.com/${GH_USER}/${BUILDER_REPO}.git \
|
|
||||||
../${BUILDER_REPO} --depth=1 -q
|
|
||||||
|
|
||||||
cp -r ../${BUILDER_REPO}/framework/* .
|
|
||||||
bash _cibuild.sh
|
|
||||||
|
|
||||||
else # triggered by Pull Request
|
|
||||||
|
|
||||||
bash tools/build.sh
|
|
||||||
bash tools/test.sh
|
|
||||||
|
|
||||||
fi
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Jekyll Theme Chirpy
|
# Jekyll Theme Chirpy
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.com/cotes2020/jekyll-theme-chirpy.svg?branch=master)](https://travis-ci.com/cotes2020/jekyll-theme-chirpy)
|
[![Build Status](https://github.com/cotes2020/jekyll-theme-chirpy/workflows/build/badge.svg?event=push)](https://github.com/cotes2020/jekyll-theme-chirpy/actions?query=event%3Apush)
|
||||||
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE)
|
||||||
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
|
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue