krata/.github/workflows/ci.yml

93 lines
2.1 KiB
YAML
Raw Normal View History

2020-01-21 20:05:06 +01:00
name: build
on:
push:
2020-03-01 18:03:58 +01:00
branches-ignore:
- stable
tags-ignore:
- '*'
2020-01-21 20:05:06 +01:00
paths-ignore:
2020-03-01 18:03:58 +01:00
- '.github/**'
- '!.github/workflows/**'
- '.travis.yml'
- '.gitignore'
- 'docs/**'
- 'README.md'
- 'LICENSE'
2020-01-21 20:05:06 +01:00
pull_request:
paths:
2020-03-01 18:03:58 +01:00
- "**"
2020-01-21 20:05:06 +01:00
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/setup-ruby@v1
with:
2020-01-25 17:45:06 +01:00
ruby-version: '2.6.x'
2020-01-21 20:05:06 +01:00
- uses: actions/setup-python@v1
with:
2020-01-25 17:45:06 +01:00
python-version: '3.7.x'
2020-01-21 20:05:06 +01:00
- 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-
2020-04-05 16:20:47 +02:00
- name: Get pip cache path
id: get-pip-cache-path
2020-01-25 17:45:06 +01:00
run: |
echo "::set-output name=path::`pip show pip | grep "Location" | awk '{print $2}'`"
2020-01-21 20:05:06 +01:00
- name: Pip caching
id: pip-cache
uses: actions/cache@v1
with:
2020-01-25 17:45:06 +01:00
path: ${{ steps.get-pip-cache-path.outputs.path }}
2020-01-21 20:05:06 +01:00
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