This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github actions replacement for travis
- Loading branch information
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/master' | ||
env: | ||
TRAVIS_SSH_SECRET: ${{ secrets.DEPLOY }} | ||
run: | | ||
./scripts/deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters