Skip to content

Commit

Permalink
Try to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robertandremitchell committed Oct 16, 2024
2 parents 953208f + 2468905 commit 80b95c7
Show file tree
Hide file tree
Showing 8 changed files with 474 additions and 194 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test tefca-viewer Container
name: CI

on:
pull_request:
Expand All @@ -10,31 +10,27 @@ on:
push:
branches:
- main
paths-ignore:
- pyproject.toml
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
TEST_RUNNER_PYTHON_VERSION: 3.10.12
CONTAINER: tefca-viewer
NODE_VERSION: 18 # Adjust the Node.js version as needed

jobs:
javascript-linting:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint javascript for ${{env.CONTAINER}}
working-directory: ./containers/${{env.CONTAINER}}
- name: Run linting
working-directory: ./query-connector
run: |
npm ci
npm run lint
test-node-containers:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -44,13 +40,13 @@ jobs:
with:
node-version: ${{env.NODE_VERSION}}
- name: Install dependencies
working-directory: ./containers/${{env.CONTAINER}} # Navigate to your Node.js app directory
working-directory: ./query-connector
run: npm install
- name: Run tests
working-directory: ./containers/${{env.CONTAINER}} # Navigate to your Node.js app directory
working-directory: ./query-connector
run: npm test

playwright-tests:
end-to-end-tests:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
Expand All @@ -61,16 +57,16 @@ jobs:
with:
node-version: ${{env.NODE_VERSION}}
- name: Install dependencies
working-directory: ./containers/${{env.CONTAINER}}
working-directory: ./query-connector
run: npm ci
- name: Install Playwright Browsers
working-directory: ./containers/${{env.CONTAINER}}
working-directory: ./query-connector
run: npx playwright install --with-deps
- name: Build Query Connector
working-directory: ./containers/${{env.CONTAINER}}
working-directory: ./query-connector
run: docker compose build --no-cache
- name: Run Query Connector
working-directory: ./containers/${{env.CONTAINER}}
working-directory: ./query-connector
run: docker compose up -d
- name: Poll until Query Connector is ready
run: |
Expand All @@ -79,10 +75,10 @@ jobs:
sleep 5
done
- name: Playwright Tests
working-directory: ./containers/${{env.CONTAINER}}
working-directory: ./query-connector
run: npx playwright test e2e --reporter=list --config playwright.config.ts
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
path: ./containers/${{env.CONTAINER}}/test-results/
path: ./query-connector/test-results/
31 changes: 0 additions & 31 deletions .github/workflows/linting-python.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/listContainers.yaml

This file was deleted.

45 changes: 6 additions & 39 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,16 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: pretty-format-json
name: Pretty Format JSON
args: [--autofix, --no-sort-keys]
- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v9.12.0"
hooks:
- id: eslint
name: ESLint for ECR Viewer
files: ^containers/ecr-viewer/.*\.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx in containers/ecr-viewer
types: [file]
additional_dependencies:
- [email protected]
- eslint-config-next
- eslint-config-prettier
- "@typescript-eslint/parser"
- "@typescript-eslint/eslint-plugin"
- typescript
- "@next/eslint-plugin-next"
- eslint-plugin-unused-imports
- eslint-plugin-jsdoc
args: ["--config=./containers/ecr-viewer/.eslintrc.json", "--fix"]
- id: eslint
name: ESLint for TEFCA Viewer
files: ^containers/tefca-viewer/.*\.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
name: ESLint
files: ^query-connector/.*\.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
additional_dependencies:
- [email protected]
Expand All @@ -44,30 +22,19 @@ repos:
- "@next/eslint-plugin-next"
- eslint-plugin-unused-imports
- eslint-plugin-jsdoc
args: ["--config=./containers/tefca-viewer/.eslintrc.json", "--fix"]
args: ["--config=./query-connector/.eslintrc.json", "--fix"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
name: Prettier
types_or: [css, javascript, tsx, ts, yaml]
- repo: local
hooks:
# run `terraform fmt` if tf files are modified and terraform is installed
# when terraform is not installed, this check will succeed even if tf files
# would not pass the format check
- id: terraform-fmt
name: terraform-fmt
entry: bash -c 'if command -v terraform >/dev/null 2>&1; then terraform fmt -recursive -check operations; else exit 0; fi'
language: system
types:
- terraform
pass_filenames: false
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
autofix_prs: true
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: [pretty-format-json, terraform-fmt]
skip: [pretty-format-json]
submodules: false
Loading

0 comments on commit 80b95c7

Please sign in to comment.