diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..c424b0ba --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,22 @@ +name: Push Docker image + +on: + release: + types: [published] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to Docker Hub + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: gristlabs/grist + tag_with_ref: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..1c83471a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows running this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7] + node-version: [10.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python packages + run: | + pip install virtualenv + yarn run install:python + + - name: Install Node.js packages + run: yarn install + + - name: Build Node.js code + run: yarn run build:prod + + - name: Run tests + run: VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test diff --git a/buildtools/prepare_python.sh b/buildtools/prepare_python.sh index 4f0cc408..77a3d73c 100755 --- a/buildtools/prepare_python.sh +++ b/buildtools/prepare_python.sh @@ -1,8 +1,11 @@ #!/bin/bash +set -e + if [ ! -e venv ]; then virtualenv -ppython2.7 venv fi . venv/bin/activate + pip install --no-deps -r sandbox/requirements.txt