Skip to content

Commit 9eb3cac

Browse files
committed
Replace Travis CI with GitHub Actions
1 parent ab78699 commit 9eb3cac

File tree

3 files changed

+71
-65
lines changed

3 files changed

+71
-65
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
jobs:
8+
build_site:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- id: nvm
13+
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
14+
- uses: actions/setup-node@v2-beta
15+
with:
16+
node-version: "${{ steps.nvm.outputs.NVMRC }}"
17+
- uses: actions/cache@v2
18+
with:
19+
path: ~/.npm
20+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
21+
restore-keys: |
22+
${{ runner.os }}-node-
23+
- run: npm install --no-optional --no-audit --no-fund --progress=false
24+
- run: npm run build
25+
- uses: actions/setup-python@v2
26+
with:
27+
python-version: "3.9"
28+
- uses: Gr1n/setup-poetry@v4
29+
with:
30+
poetry-version: '1.1.4'
31+
- uses: actions/cache@v2
32+
with:
33+
path: ~/.cache/pip
34+
key: ${{ runner.os }}-python-${{ hashFiles('**/poetry.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-python-
37+
- run: |
38+
poetry config virtualenvs.create false &&
39+
poetry install
40+
- run: poetry run django-admin runserver --settings=tests.settings.production --pythonpath=. &
41+
# Python linting.
42+
- run: tox -e lint
43+
# Docs website build.
44+
- run: poetry run mkdocs build --strict
45+
# Demo website build.
46+
- run: wget --mirror --page-requisites --no-parent --no-verbose http://localhost:8000/django-pattern-library/demo/pattern-library/
47+
- run: mv localhost:8000/django-pattern-library/demo site
48+
# Demo render_patterns.
49+
- run: poetry run django-admin render_patterns --settings=tests.settings.production --pythonpath=. --wrap-fragments --output=site/dpl-rendered-patterns
50+
# Package build, incl. publishing an experimental pre-release via GitHub Pages for builds on `master`.
51+
- run: cat pyproject.toml| awk '{sub(/^version = .+/,"version = \"0.0.0.dev\"")}1' > pyproject.toml.tmp && mv pyproject.toml.tmp pyproject.toml
52+
- run: poetry build
53+
- run: mv dist site
54+
- uses: actions/upload-artifact@v2
55+
with:
56+
name: site
57+
path: site
58+
retention-days: 1
59+
deploy_site:
60+
runs-on: ubuntu-latest
61+
needs: build_site
62+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
63+
steps:
64+
- uses: actions/checkout@v2
65+
- uses: actions/download-artifact@v2
66+
- uses: JamesIves/[email protected]
67+
with:
68+
branch: gh-pages
69+
folder: site
70+
clean: true

.travis.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [django-pattern-library](https://torchbox.github.io/django-pattern-library/)
22

3-
[![PyPI](https://img.shields.io/pypi/v/django-pattern-library.svg)](https://pypi.org/project/django-pattern-library/) [![PyPI downloads](https://img.shields.io/pypi/dm/django-pattern-library.svg)](https://pypi.org/project/django-pattern-library/) [![Travis](https://travis-ci.com/torchbox/django-pattern-library.svg?branch=master)](https://travis-ci.com/torchbox/django-pattern-library) [![Total alerts](https://img.shields.io/lgtm/alerts/g/torchbox/django-pattern-library.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/torchbox/django-pattern-library/alerts/)
3+
[![PyPI](https://img.shields.io/pypi/v/django-pattern-library.svg)](https://pypi.org/project/django-pattern-library/) [![PyPI downloads](https://img.shields.io/pypi/dm/django-pattern-library.svg)](https://pypi.org/project/django-pattern-library/) [![Build status](https://github.com/torchbox/django-pattern-library/workflows/CI/badge.svg)](https://github.com/torchbox/django-pattern-library/actions) [![Total alerts](https://img.shields.io/lgtm/alerts/g/torchbox/django-pattern-library.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/torchbox/django-pattern-library/alerts/)
44

55
> UI pattern libraries for Django templates. Try our [online demo](https://torchbox.github.io/django-pattern-library/demo/pattern-library/).
66

0 commit comments

Comments
 (0)