-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert CI workflow (1 of 2) #6965
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 |
---|---|---|
|
@@ -3,29 +3,12 @@ on: | |
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
pull_request_target: | ||
branches: | ||
- master | ||
env: | ||
CYPRESS_COVERAGE: "true" | ||
NODE_VERSION: 18 | ||
YARN_VERSION: 1.22.22 | ||
REDASH_COOKIE_SECRET: 2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF | ||
REDASH_SECRET_KEY: 2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
DOCKER_BUILDKIT: 1 | ||
FRONTEND_BUILD_MODE: 1 | ||
INSTALL_GROUPS: main,all_ds,dev | ||
PERCY_BRANCH: ${{github.head_ref || github.ref_name}} | ||
PERCY_COMMIT: ${{github.sha}} | ||
PERCY_PULL_REQUEST: ${{github.event.number}} | ||
COMMIT_INFO_BRANCH: ${{github.head_ref || github.ref_name}} | ||
COMMIT_INFO_MESSAGE: ${{github.event.head_commit.message}} | ||
COMMIT_INFO_AUTHOR: ${{github.event.pull_request.user.login}} | ||
COMMIT_INFO_SHA: ${{github.sha}} | ||
COMMIT_INFO_REMOTE: ${{github.server_url}}/${{github.repository}} | ||
jobs: | ||
backend-lint: | ||
runs-on: ubuntu-22.04 | ||
|
@@ -40,15 +23,18 @@ jobs: | |
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
- run: sudo pip install black==24.3.0 ruff==0.1.9 | ||
- run: sudo pip install black==23.1.0 ruff==0.0.287 | ||
- run: ruff check . | ||
- run: black --check . | ||
|
||
backend-unit-tests: | ||
runs-on: ubuntu-22.04 | ||
needs: backend-lint | ||
env: | ||
FRONTEND_BUILD_MODE: 0 | ||
COMPOSE_FILE: .ci/compose.ci.yaml | ||
COMPOSE_PROJECT_NAME: redash | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
DOCKER_BUILDKIT: 1 | ||
steps: | ||
- if: github.event.pull_request.mergeable == 'false' | ||
name: Exit if PR is not mergeable | ||
|
@@ -60,34 +46,31 @@ jobs: | |
- name: Build Docker Images | ||
run: | | ||
set -x | ||
touch .env | ||
docker compose build | ||
docker compose build --build-arg install_groups="main,all_ds,dev" --build-arg skip_frontend_build=true | ||
docker compose up -d | ||
sleep 10 | ||
- name: Create Test Database | ||
run: docker compose run --rm postgres psql -h postgres -U postgres -c "create database tests;" | ||
run: docker compose -p redash run --rm postgres psql -h postgres -U postgres -c "create database tests;" | ||
- name: List Enabled Query Runners | ||
run: docker compose run --rm server manage ds list_types | ||
run: docker compose -p redash run --rm redash manage ds list_types | ||
- name: Run Tests | ||
run: docker compose run --name tests server tests --junitxml=junit.xml --cov-report=xml --cov=redash --cov-config=.coveragerc tests/ | ||
run: docker compose -p redash run --name tests redash tests --junitxml=junit.xml --cov-report=xml --cov=redash --cov-config=.coveragerc tests/ | ||
- name: Copy Test Results | ||
run: | | ||
mkdir -p /tmp/test-results/unit-tests | ||
docker cp tests:/app/coverage.xml ./coverage.xml | ||
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@v4 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: backend-test-results | ||
name: test-results | ||
path: /tmp/test-results | ||
- name: Store Coverage Results | ||
uses: actions/upload-artifact@v4 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: backend-coverage | ||
name: coverage | ||
path: coverage.xml | ||
|
||
frontend-lint: | ||
|
@@ -107,14 +90,13 @@ jobs: | |
- name: Install Dependencies | ||
run: | | ||
npm install --global --force yarn@$YARN_VERSION | ||
yarn cache clean | ||
yarn --frozen-lockfile --network-concurrency 1 | ||
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- name: Run Lint | ||
run: yarn lint:ci | ||
- name: Store Test Results | ||
uses: actions/upload-artifact@v4 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: frontend-test-results | ||
name: test-results | ||
path: /tmp/test-results | ||
|
||
frontend-unit-tests: | ||
|
@@ -135,24 +117,21 @@ jobs: | |
- name: Install Dependencies | ||
run: | | ||
npm install --global --force yarn@$YARN_VERSION | ||
yarn cache clean | ||
yarn --frozen-lockfile --network-concurrency 1 | ||
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- name: Run App Tests | ||
run: yarn test | ||
- name: Run Visualizations Tests | ||
run: | | ||
cd viz-lib | ||
yarn test | ||
run: cd viz-lib && yarn test | ||
- run: yarn lint | ||
|
||
frontend-e2e-tests: | ||
runs-on: ubuntu-22.04 | ||
needs: frontend-lint | ||
env: | ||
COMPOSE_FILE: .ci/compose.cypress.yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above. |
||
COMPOSE_PROJECT_NAME: cypress | ||
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
INSTALL_GROUPS: main | ||
COMPOSE_PROFILES: e2e | ||
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | ||
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
|
@@ -168,16 +147,17 @@ jobs: | |
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'yarn' | ||
- name: Enable Code Coverage Report For Master Branch | ||
if: endsWith(github.ref, '/master') | ||
run: | | ||
echo "CODE_COVERAGE=true" >> "$GITHUB_ENV" | ||
- name: Install Dependencies | ||
run: | | ||
npm install --global --force yarn@$YARN_VERSION | ||
yarn cache clean | ||
yarn --frozen-lockfile --network-concurrency 1 | ||
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 | ||
- name: Setup Redash Server | ||
run: | | ||
set -x | ||
touch .env | ||
yarn build | ||
yarn cypress build | ||
yarn cypress start -- --skip-db-seed | ||
docker compose run cypress yarn cypress db-seed | ||
|
@@ -189,12 +169,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@v4 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: frontend-coverage | ||
name: coverage | ||
path: coverage | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: frontend | ||
path: client/dist | ||
retention-days: 1 |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed a sub-directory? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no. I am staging this as two separate commits. I'll post the second so you can see what I'm trying to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries. 😄