forked from getredash/redash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'getredash:master' into master
- Loading branch information
Showing
250 changed files
with
10,565 additions
and
3,850 deletions.
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
FROM cypress/browsers:node16.18.0-chrome90-ff88 | ||
FROM cypress/browsers:node18.12.0-chrome106-ff106 | ||
|
||
ENV APP /usr/src/app | ||
WORKDIR $APP | ||
|
||
COPY package.json yarn.lock .yarnrc $APP/ | ||
COPY viz-lib $APP/viz-lib | ||
RUN npm install [email protected].19 -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null | ||
RUN npm install [email protected].22 -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null | ||
|
||
COPY . $APP | ||
|
||
|
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
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
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
client/.tmp/ | ||
client/dist/ | ||
node_modules/ | ||
viz-lib/node_modules/ | ||
.tmp/ | ||
|
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 |
---|---|---|
|
@@ -3,17 +3,24 @@ on: | |
push: | ||
branches: | ||
- master | ||
pull_request: | ||
pull_request_target: | ||
branches: | ||
- master | ||
env: | ||
NODE_VERSION: 16.20.1 | ||
NODE_VERSION: 18 | ||
YARN_VERSION: 1.22.22 | ||
jobs: | ||
backend-lint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- if: github.event.pull_request.mergeable == 'false' | ||
name: Exit if PR is not mergeable | ||
run: exit 1 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions/setup-python@v4 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
- run: sudo pip install black==23.1.0 ruff==0.0.287 | ||
|
@@ -24,14 +31,18 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
needs: backend-lint | ||
env: | ||
COMPOSE_FILE: .ci/docker-compose.ci.yml | ||
COMPOSE_FILE: .ci/compose.ci.yaml | ||
COMPOSE_PROJECT_NAME: redash | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
DOCKER_BUILDKIT: 1 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- if: github.event.pull_request.mergeable == 'false' | ||
name: Exit if PR is not mergeable | ||
run: exit 1 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Build Docker Images | ||
run: | | ||
set -x | ||
|
@@ -51,53 +62,63 @@ jobs: | |
docker cp tests:/app/junit.xml /tmp/test-results/unit-tests/results.xml | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
- name: Store Test Results | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
name: backend-test-results | ||
path: /tmp/test-results | ||
- name: Store Coverage Results | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage | ||
path: coverage.xml | ||
|
||
frontend-lint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- if: github.event.pull_request.mergeable == 'false' | ||
name: Exit if PR is not mergeable | ||
run: exit 1 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions/setup-node@v3 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
- name: Install Dependencies | ||
run: | | ||
npm install --global --force yarn@1.22.19 | ||
npm install --global --force yarn@$YARN_VERSION | ||
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- name: Run Lint | ||
run: yarn lint:ci | ||
- name: Store Test Results | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
name: frontend-test-results | ||
path: /tmp/test-results | ||
|
||
frontend-unit-tests: | ||
runs-on: ubuntu-22.04 | ||
needs: frontend-lint | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- if: github.event.pull_request.mergeable == 'false' | ||
name: Exit if PR is not mergeable | ||
run: exit 1 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions/setup-node@v3 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
- name: Install Dependencies | ||
run: | | ||
npm install --global --force yarn@1.22.19 | ||
npm install --global --force yarn@$YARN_VERSION | ||
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- name: Run App Tests | ||
run: yarn test | ||
|
@@ -109,18 +130,22 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
needs: frontend-lint | ||
env: | ||
COMPOSE_FILE: .ci/docker-compose.cypress.yml | ||
COMPOSE_FILE: .ci/compose.cypress.yaml | ||
COMPOSE_PROJECT_NAME: cypress | ||
PERCY_TOKEN_ENCODED: ZGRiY2ZmZDQ0OTdjMzM5ZWE0ZGQzNTZiOWNkMDRjOTk4Zjg0ZjMxMWRmMDZiM2RjOTYxNDZhOGExMjI4ZDE3MA== | ||
CYPRESS_PROJECT_ID_ENCODED: OTI0Y2th | ||
CYPRESS_RECORD_KEY_ENCODED: YzA1OTIxMTUtYTA1Yy00NzQ2LWEyMDMtZmZjMDgwZGI2ODgx | ||
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | ||
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- if: github.event.pull_request.mergeable == 'false' | ||
name: Exit if PR is not mergeable | ||
run: exit 1 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions/setup-node@v3 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
|
@@ -130,7 +155,7 @@ jobs: | |
echo "CODE_COVERAGE=true" >> "$GITHUB_ENV" | ||
- name: Install Dependencies | ||
run: | | ||
npm install --global --force yarn@1.22.19 | ||
npm install --global --force yarn@$YARN_VERSION | ||
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- name: Setup Redash Server | ||
run: | | ||
|
@@ -146,93 +171,7 @@ jobs: | |
- name: Copy Code Coverage Results | ||
run: docker cp cypress:/usr/src/app/coverage ./coverage || true | ||
- name: Store Coverage Results | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage | ||
path: coverage | ||
|
||
build-skip-check: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
skip: ${{ steps.skip-check.outputs.skip }} | ||
steps: | ||
- name: Skip? | ||
id: skip-check | ||
run: | | ||
if [[ "${{ vars.DOCKER_USER }}" == '' ]]; then | ||
echo 'Docker user is empty. Skipping build+push' | ||
echo skip=true >> "$GITHUB_OUTPUT" | ||
elif [[ "${{ secrets.DOCKER_PASS }}" == '' ]]; then | ||
echo 'Docker password is empty. Skipping build+push' | ||
echo skip=true >> "$GITHUB_OUTPUT" | ||
elif [[ "${{ github.ref_name }}" != 'master' ]]; then | ||
echo 'Ref name is not `master`. Skipping build+push' | ||
echo skip=true >> "$GITHUB_OUTPUT" | ||
else | ||
echo 'Docker user and password are set and branch is `master`.' | ||
echo 'Building + pushing `preview` image.' | ||
echo skip=false >> "$GITHUB_OUTPUT" | ||
fi | ||
build-docker-image: | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- backend-unit-tests | ||
- frontend-unit-tests | ||
- frontend-e2e-tests | ||
- build-skip-check | ||
if: needs.build-skip-check.outputs.skip == 'false' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
- name: Install Dependencies | ||
run: | | ||
npm install --global --force [email protected] | ||
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- name: Set up QEMU | ||
timeout-minutes: 1 | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ vars.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASS }} | ||
|
||
- name: Bump version | ||
id: version | ||
run: | | ||
set -x | ||
.ci/update_version | ||
VERSION=$(jq -r .version package.json) | ||
VERSION_TAG="${VERSION}.b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}" | ||
echo "VERSION_TAG=$VERSION_TAG" >> "$GITHUB_OUTPUT" | ||
- name: Build and push preview image to Docker Hub | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
tags: | | ||
redash/redash:preview | ||
redash/preview:${{ steps.version.outputs.VERSION_TAG }} | ||
context: . | ||
build-args: | | ||
test_all_deps=true | ||
cache-from: type=ghq | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
env: | ||
DOCKER_CONTENT_TRUST: true | ||
|
||
- name: "Failure: output container logs to console" | ||
if: failure() | ||
run: docker compose logs |
Oops, something went wrong.