Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
add github actions replacement for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
goapunk committed Jul 1, 2021
1 parent 6c5aeef commit dbade5f
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
68 changes: 68 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Django CI

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

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '12.x'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache pip packages
uses: actions/cache@v2
env:
cache-name: cache-pip-packages
with:
path: ~/.cache/pip
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements/dev.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: |
npm install
npm run build
pip install -r requirements/dev.txt
pip install coveralls
- name: Run Tests
run: |
python manage.py collectstatic > /dev/null
py.test --cov
isort --diff -c civic_europe tests
python manage.py makemigrations --dry-run --check --noinput
flake8 civic_europe tests --exclude migrations,settings
npm run lint
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.COV }}
run: |
coveralls
- name: Deploy
if: github.ref == 'refs/heads/main'
env:
TRAVIS_SSH_SECRET: ${{ secrets.DEPLOY }}
run: |
./scripts/deploy.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Civic Europe is a platform for an idea challenge. It is
based on [adhocracy 4](https://github.com/liqd/adhocracy4).

[![Build Status](https://travis-ci.org/liqd/a4-civic-europe.svg?branch=master)](https://travis-ci.org/liqd/a4-civic-europe)
![Build Status](https://github.com/liqd/a4-civic-europe/actions/workflows/django.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/liqd/a4-civic-europe/badge.svg?branch=master)](https://coveralls.io/github/liqd/a4-civic-europe?branch=master)

## Requirements
Expand Down

0 comments on commit dbade5f

Please sign in to comment.