mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) run test:docker target prior to pushing grist-core image
Summary: This activates the new tests that can run on a grist-core image, and will not push a new version to `latest` tag unless those tests pass. This also runs a smoke test in the regular CI tests, to confirm the code continues to work without GRIST_TEST_LOGIN enabled. Test Plan: tested on a fork of grist-core Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3186
This commit is contained in:
parent
1ae586cf42
commit
65ac8aaa85
30
.github/workflows/docker_latest.yml
vendored
30
.github/workflows/docker_latest.yml
vendored
@ -15,11 +15,41 @@ jobs:
|
||||
push_to_registry:
|
||||
name: Push latest Docker image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [2.7]
|
||||
node-version: [10.x]
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: latest_candidate
|
||||
- name: Prepare image but do not push it yet
|
||||
uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
repository: ${{ github.repository_owner }}/grist
|
||||
tags: latest
|
||||
push: false
|
||||
- name: Use Node.js ${{ matrix.node-version }} for testing
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }} for testing - maybe not needed
|
||||
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: TEST_IMAGE=${{ github.repository_owner }}/grist VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:docker
|
||||
- name: Push to Docker Hub
|
||||
uses: docker/build-push-action@v1
|
||||
with:
|
||||
|
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@ -41,7 +41,10 @@ jobs:
|
||||
- name: Build Node.js code
|
||||
run: yarn run build:prod
|
||||
|
||||
- name: Run tests
|
||||
- name: Run smoke test
|
||||
run: VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test:smoke
|
||||
|
||||
- name: Run main tests
|
||||
run: VERBOSE=1 DEBUG=1 MOCHA_WEBDRIVER_HEADLESS=1 yarn run test
|
||||
|
||||
- name: Update candidate branch
|
||||
|
@ -19,12 +19,13 @@ DOCKER_CONTAINER=grist-core-test
|
||||
DOCKER_PID=""
|
||||
|
||||
cleanup() {
|
||||
return_value=$?
|
||||
docker rm -f $DOCKER_CONTAINER
|
||||
if [ -n "$DOCKER_PID" ]; then
|
||||
wait $DOCKER_PID || echo "docker container gone"
|
||||
fi
|
||||
echo "Cleaned up docker container, bye."
|
||||
exit 0
|
||||
exit $return_value
|
||||
}
|
||||
|
||||
docker run --name $DOCKER_CONTAINER --rm \
|
||||
@ -33,7 +34,7 @@ docker run --name $DOCKER_CONTAINER --rm \
|
||||
--env GRIST_SESSION_COOKIE=grist_test_cookie \
|
||||
--env GRIST_TEST_LOGIN=1 \
|
||||
--env TEST_SUPPORT_API_KEY=api_key_for_support \
|
||||
gristlabs/grist &
|
||||
${TEST_IMAGE:-gristlabs/grist} &
|
||||
|
||||
DOCKER_PID="$!"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user