mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
103ebbb045
Extends workflow to test snapshots with minio.
102 lines
3.0 KiB
YAML
102 lines
3.0 KiB
YAML
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: [3.9]
|
|
node-version: [14.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: Make sure bucket is versioned
|
|
env:
|
|
AWS_ACCESS_KEY_ID: administrator
|
|
AWS_SECRET_ACCESS_KEY: administrator
|
|
run: aws --region us-east-1 --endpoint-url http://localhost:9000 s3api put-bucket-versioning --bucket grist-docs-test --versioning-configuration Status=Enabled
|
|
|
|
- name: Build Node.js code
|
|
run: yarn run build:prod
|
|
|
|
- name: Run smoke test
|
|
run: VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:smoke
|
|
|
|
- name: Run python tests
|
|
run: yarn run test:python
|
|
|
|
- name: Run server tests with minio and redis
|
|
run: MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:server
|
|
env:
|
|
GRIST_DOCS_MINIO_ACCESS_KEY: administrator
|
|
GRIST_DOCS_MINIO_SECRET_KEY: administrator
|
|
TEST_REDIS_URL: "redis://localhost/11"
|
|
GRIST_DOCS_MINIO_USE_SSL: 0
|
|
GRIST_DOCS_MINIO_ENDPOINT: localhost
|
|
GRIST_DOCS_MINIO_PORT: 9000
|
|
GRIST_DOCS_MINIO_BUCKET: grist-docs-test
|
|
|
|
- name: Run main tests without minio and redis
|
|
run: MOCHA_WEBDRIVER_HEADLESS=1 yarn run test --exclude '_build/test/server/**/*'
|
|
|
|
- name: Update candidate branch
|
|
if: ${{ github.event_name == 'push' }}
|
|
uses: ad-m/github-push-action@8407731efefc0d8f72af254c74276b7a90be36e1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: latest_candidate
|
|
force: true
|
|
|
|
services:
|
|
# https://github.com/bitnami/bitnami-docker-minio/issues/16
|
|
minio:
|
|
image: bitnami/minio:latest
|
|
env:
|
|
MINIO_DEFAULT_BUCKETS: "grist-docs-test:public"
|
|
MINIO_ROOT_USER: administrator
|
|
MINIO_ROOT_PASSWORD: administrator
|
|
ports:
|
|
- 9000:9000
|
|
options: >-
|
|
--health-cmd "curl -f http://localhost:9000/minio/health/ready"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
redis:
|
|
image: redis
|
|
ports:
|
|
- 6379:6379
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|