diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 0000000..57ebae2 --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,14 @@ +name: Validate Gradle Wrapper +on: + push: + branches: [main, main-okta] + pull_request: + branches: [main, main-okta] + +jobs: + validation: + name: Validation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml new file mode 100644 index 0000000..926b52b --- /dev/null +++ b/.github/workflows/integration-test.yml @@ -0,0 +1,60 @@ +name: Integration Tests +on: + push: + branches: [main, main-okta] + pull_request: + branches: [main, main-okta] + +jobs: + run-test: + name: Run tests and build frontend + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Get changed files in the frontend folder + id: was-any-frontend-files-changed + uses: tj-actions/changed-files@v34 + with: + files: frontend/** + + - name: Setup packages + if: steps.was-any-frontend-files-changed.outputs.any_changed == 'true' + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'npm' + cache-dependency-path: frontend/package-lock.json + + - name: Install packages + if: steps.was-any-frontend-files-changed.outputs.any_changed == 'true' + working-directory: ./frontend + run: npm ci + + - name: Run lint + if: steps.was-any-frontend-files-changed.outputs.any_changed == 'true' + working-directory: ./frontend + run: npm run lint + + - name: Run unit tests + if: steps.was-any-frontend-files-changed.outputs.any_changed == 'true' + working-directory: ./frontend + run: npm run test:unit:ci + + - name: Run build + if: steps.was-any-frontend-files-changed.outputs.any_changed == 'true' + working-directory: ./frontend + run: npm run build + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: 'gradle' + + - run: ./gradlew build --no-daemon diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml deleted file mode 100644 index 61adb2b..0000000 --- a/.github/workflows/pr-checks.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: "PR Checklist checked" -on: - pull_request_target: - types: [opened, edited, synchronize, reopened] - -jobs: - task-check: - runs-on: ubuntu-latest - steps: - - uses: kentaro-m/task-completed-checker-action@v0.1.1 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - - uses: dekinderfiets/pr-description-enforcer@0.0.1 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index 1ae98de..9e849b8 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -7,10 +7,10 @@ module.exports = { 'plugin:vue/vue3-essential', 'eslint:recommended', '@vue/eslint-config-typescript', - '@vue/eslint-config-prettier' + '@vue/eslint-config-prettier', ], parserOptions: { - ecmaVersion: 'latest' + ecmaVersion: 'latest', }, rules: { 'vue/multi-word-component-names': 0, @@ -39,5 +39,5 @@ module.exports = { ignoreHTMLTextContents: false, }, ], - } + }, } diff --git a/frontend/package.json b/frontend/package.json index 82dd3af..daad1a2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,7 +12,7 @@ "test:e2e": "playwright test", "build-only": "vite build", "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", - "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" + "lint": "eslint . --ext .vue,.js,.jsx,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" }, "dependencies": { "@codemirror/lang-json": "^6.0.0", diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts index 333a4dc..95c5730 100644 --- a/frontend/playwright.config.ts +++ b/frontend/playwright.config.ts @@ -11,102 +11,102 @@ import { devices } from '@playwright/test' * See https://playwright.dev/docs/test-configuration. */ const config: PlaywrightTestConfig = { - testDir: './e2e', - /* Maximum time one test can run for. */ - timeout: 30 * 1000, - expect: { - /** - * Maximum time expect() should wait for the condition to be met. - * For example in `await expect(locator).toHaveText();` - */ - timeout: 5000 - }, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ - actionTimeout: 0, - /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: 'http://localhost:5173', - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', + testDir: './e2e', + /* Maximum time one test can run for. */ + timeout: 30 * 1000, + expect: { + /** + * Maximum time expect() should wait for the condition to be met. + * For example in `await expect(locator).toHaveText();` + */ + timeout: 5000, + }, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ + actionTimeout: 0, + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: 'http://localhost:5173', - /* Only on CI systems run the tests headless */ - headless: !!process.env.CI - }, + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { - ...devices['Desktop Chrome'] - } + /* Only on CI systems run the tests headless */ + headless: !!process.env.CI, }, - { - name: 'firefox', - use: { - ...devices['Desktop Firefox'] - } - }, - { - name: 'webkit', - use: { - ...devices['Desktop Safari'] - } - } - /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { - // ...devices['Pixel 5'], - // }, - // }, - // { - // name: 'Mobile Safari', - // use: { - // ...devices['iPhone 12'], - // }, - // }, + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: { + ...devices['Desktop Chrome'], + }, + }, + { + name: 'firefox', + use: { + ...devices['Desktop Firefox'], + }, + }, + { + name: 'webkit', + use: { + ...devices['Desktop Safari'], + }, + }, + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { + // ...devices['Pixel 5'], + // }, + // }, + // { + // name: 'Mobile Safari', + // use: { + // ...devices['iPhone 12'], + // }, + // }, - /* Test against branded browsers. */ - // { - // name: 'Microsoft Edge', - // use: { - // channel: 'msedge', - // }, - // }, - // { - // name: 'Google Chrome', - // use: { - // channel: 'chrome', - // }, - // }, - ], + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { + // channel: 'msedge', + // }, + // }, + // { + // name: 'Google Chrome', + // use: { + // channel: 'chrome', + // }, + // }, + ], - /* Folder for test artifacts such as screenshots, videos, traces, etc. */ - // outputDir: 'test-results/', + /* Folder for test artifacts such as screenshots, videos, traces, etc. */ + // outputDir: 'test-results/', - /* Run your local dev server before starting the tests */ - webServer: { - /** + /* Run your local dev server before starting the tests */ + webServer: { + /** * Use the dev server by default for faster feedback loop. * Use the preview server on CI for more realistic testing. Playwright will re-use the local server if there is already a dev-server running. */ - command: process.env.CI ? 'vite preview --port 5173' : 'vite dev', - port: 5173, - reuseExistingServer: !process.env.CI - } + command: process.env.CI ? 'vite preview --port 5173' : 'vite dev', + port: 5173, + reuseExistingServer: !process.env.CI, + }, } export default config diff --git a/frontend/src/components/BaseButton.vue b/frontend/src/components/BaseButton.vue index ab8a3db..179c26b 100644 --- a/frontend/src/components/BaseButton.vue +++ b/frontend/src/components/BaseButton.vue @@ -11,14 +11,14 @@
{{ label }}