Set up ci
This commit is contained in:
Родитель
9bff58139f
Коммит
8c13d69c18
|
@ -0,0 +1,47 @@
|
|||
name: Continuous Integration
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- github-actions # TODO: remove
|
||||
jobs:
|
||||
node_test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: set up Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '8.x'
|
||||
|
||||
- name: set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '2.7'
|
||||
|
||||
- name: pre-installation
|
||||
run: |
|
||||
if [ ! -d $HOME/google-cloud-sdk/bin ]; then rm -rf $HOME/google-cloud-sdk; curl https://sdk.cloud.google.com | bash > /dev/null; fi
|
||||
source $HOME/google-cloud-sdk/path.bash.inc
|
||||
gcloud components update -q
|
||||
gcloud components install app-engine-python
|
||||
gcloud version
|
||||
|
||||
- name: installation
|
||||
run: |
|
||||
npm install -g gulp
|
||||
npm install
|
||||
npm run ci-dep
|
||||
|
||||
- name: lint
|
||||
run: npm run lint
|
||||
|
||||
- name: test
|
||||
run: npm run test
|
||||
|
||||
- name: build
|
||||
run: npm run build
|
||||
|
||||
- name: clean up
|
||||
run: df -h
|
36
.travis.yml
36
.travis.yml
|
@ -1,36 +0,0 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
python:
|
||||
- "2.7"
|
||||
dist: trusty
|
||||
sudo: false
|
||||
git:
|
||||
depth: 1
|
||||
env:
|
||||
global:
|
||||
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
|
||||
- CLOUDSDK_PYTHON_SITEPACKAGES=1
|
||||
- GAE_APP_ID=cr-status
|
||||
cache:
|
||||
yarn: true
|
||||
pip: true
|
||||
directories:
|
||||
- node_modules
|
||||
before_install:
|
||||
- if [ ! -d $HOME/google-cloud-sdk/bin ]; then rm -rf $HOME/google-cloud-sdk; curl https://sdk.cloud.google.com | bash > /dev/null; fi
|
||||
- source $HOME/google-cloud-sdk/path.bash.inc
|
||||
- gcloud components update -q
|
||||
- gcloud components install app-engine-python
|
||||
- gcloud version
|
||||
|
||||
install:
|
||||
- npm install -g gulp
|
||||
- npm install
|
||||
- npm run travis-deps
|
||||
script:
|
||||
- npm run lint
|
||||
- npm run test
|
||||
- npm run build
|
||||
after_success:
|
||||
- df -h
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Note: We now install and update the Google Cloud SDK in .travis.yml.
|
||||
# Note: We now install and update the Google Cloud SDK in ci.yml.
|
||||
# The rest of this file does configuraton and authorization steps.
|
||||
|
||||
# Decrypt the Service Account Key
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"deps": "python -m pip install -t lib -r requirements.txt --upgrade",
|
||||
"travis-deps": "pip install -t lib -r requirements.travis.txt --upgrade",
|
||||
"ci-dep": "pip install -t lib -r requirements.ci.txt --upgrade",
|
||||
"dev-deps": "python -m pip install --no-deps -r requirements.dev.txt",
|
||||
"do-tests": "curl -X POST 'http://localhost:15606/reset' && python -m unittest discover -p '*_test.py' -b",
|
||||
"start-emulator" : "gcloud beta emulators datastore start --host-port=:15606 --no-store-on-disk --consistency=1.0",
|
||||
|
|
|
@ -7,5 +7,5 @@ Flask==1.1.2
|
|||
requests==2.25.1
|
||||
requests-toolbelt==0.9.1
|
||||
|
||||
# Google cloud tasks is not used on travis because one of its dependencies
|
||||
# Google cloud tasks is not used on GitHub Actions because one of its dependencies
|
||||
# will not compiled. The unit tests use a fake object as the GCT client.
|
|
@ -23,6 +23,8 @@ import unittest
|
|||
app_engine_path = os.environ.get('APP_ENGINE_PATH', '')
|
||||
if not app_engine_path:
|
||||
app_engine_path = '/usr/lib/google-cloud-sdk/platform/google_appengine'
|
||||
|
||||
#TODO(kyleju): fix this path once GitHub actions is working.
|
||||
if not os.path.exists(app_engine_path):
|
||||
app_engine_path = '/home/travis/google-cloud-sdk/platform/google_appengine'
|
||||
if os.path.exists(app_engine_path):
|
||||
|
|
Загрузка…
Ссылка в новой задаче