Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 91 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,26 @@ jobs:
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-npm-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-v3-cypress14-
${{ runner.os }}-npm-v3-
${{ runner.os }}-npm-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: node_modules
key: ${{ runner.os }}-modules-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-v3-cypress14-
${{ runner.os }}-modules-v3-
${{ runner.os }}-modules-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-bin-v2-${{ hashFiles('**/package-lock.json') }}
key: cypress-${{ runner.os }}-bin-v3-14.5.2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-bin-v2-
cypress-${{ runner.os }}-bin-v3-14.5.2-
cypress-${{ runner.os }}-bin-v3-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: ".nvmrc"
Expand Down Expand Up @@ -78,21 +83,26 @@ jobs:
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-npm-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-v3-cypress14-
${{ runner.os }}-npm-v3-
${{ runner.os }}-npm-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: node_modules
key: ${{ runner.os }}-modules-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-v3-cypress14-
${{ runner.os }}-modules-v3-
${{ runner.os }}-modules-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-bin-v2-${{ hashFiles('**/package-lock.json') }}
key: cypress-${{ runner.os }}-bin-v3-14.5.2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-bin-v2-
cypress-${{ runner.os }}-bin-v3-14.5.2-
cypress-${{ runner.os }}-bin-v3-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: ".nvmrc"
Expand All @@ -119,21 +129,26 @@ jobs:
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-npm-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-v3-cypress14-
${{ runner.os }}-npm-v3-
${{ runner.os }}-npm-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: node_modules
key: ${{ runner.os }}-modules-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-v3-cypress14-
${{ runner.os }}-modules-v3-
${{ runner.os }}-modules-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-bin-v2-${{ hashFiles('**/package-lock.json') }}
key: cypress-${{ runner.os }}-bin-v3-14.5.2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-bin-v2-
cypress-${{ runner.os }}-bin-v3-14.5.2-
cypress-${{ runner.os }}-bin-v3-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: ".nvmrc"
Expand All @@ -149,47 +164,101 @@ jobs:
integration:
name: run cypress tests
runs-on: ubuntu-latest
strategy:
# Don't cancel other jobs if one fails
fail-fast: false
matrix:
# Could be extended for parallel execution in the future
containers: [1]
env:
VELA_API: "http://localhost:8080"
TERM: xterm
# Cypress 14.5.2 optimizations
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
CI: true
# Disable Cypress video recording in CI for faster runs
CYPRESS_video: false
# Optimize Cypress for CI - increased timeouts for slower CI environment
CYPRESS_defaultCommandTimeout: 25000
CYPRESS_requestTimeout: 25000
CYPRESS_responseTimeout: 25000
CYPRESS_pageLoadTimeout: 40000

permissions:
actions: write # for actions/cache to write to cache location

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Skip Cypress tests for documentation-only changes
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.2
id: changes
with:
filters: |
src:
- 'src/**'
- 'cypress/**'
- 'package*.json'
- '.nvmrc'
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
if: steps.changes.outputs.src == 'true'
with:
path: ~/.elm
key: ${{ runner.os }}-elm-v3-${{ hashFiles('**/elm.json') }}
restore-keys: |
${{ runner.os }}-elm-v3-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
if: steps.changes.outputs.src == 'true'
with:
path: ~/.npm
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-npm-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-v3-cypress14-
${{ runner.os }}-npm-v3-
${{ runner.os }}-npm-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: node_modules
key: ${{ runner.os }}-modules-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-v3-cypress14-
${{ runner.os }}-modules-v3-
${{ runner.os }}-modules-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-bin-v2-${{ hashFiles('**/package-lock.json') }}
key: cypress-${{ runner.os }}-bin-v3-14.5.2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-bin-v2-
cypress-${{ runner.os }}-bin-v3-14.5.2-
cypress-${{ runner.os }}-bin-v3-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: ".nvmrc"

- name: install dependencies
if: steps.changes.outputs.src == 'true'
run: npm ci --prefer-offline --no-audit

# Install Chrome for better Cypress performance
- name: install Chrome
if: steps.changes.outputs.src == 'true'
run: |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y google-chrome-stable

# Verify Cypress installation and cache
- name: verify Cypress
if: steps.changes.outputs.src == 'true'
run: npx cypress verify

- name: run cypress tests
if: steps.changes.outputs.src == 'true'
run: npm run test:cy
env:
# Override to use installed Chrome
CYPRESS_RUN_BINARY: ""

# ┌─┐┬ ┬┌┐ ┬ ┬┌─┐┬ ┬
# ├─┘│ │├┴┐│ │└─┐├─┤
Expand All @@ -214,14 +283,18 @@ jobs:
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-npm-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-v3-cypress14-
${{ runner.os }}-npm-v3-
${{ runner.os }}-npm-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: node_modules
key: ${{ runner.os }}-modules-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-v3-cypress14-
${{ runner.os }}-modules-v3-
${{ runner.os }}-modules-v2-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ jobs:
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-npm-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-v3-cypress14-
${{ runner.os }}-npm-v3-
${{ runner.os }}-npm-v2-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: node_modules
key: ${{ runner.os }}-modules-v2-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-modules-v3-cypress14-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-v3-cypress14-
${{ runner.os }}-modules-v3-
${{ runner.os }}-modules-v2-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,4 @@ secrets.env

# Idea
.idea/
/.claude
25 changes: 25 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const { defineConfig } = require('cypress');

module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:8888',
video: false,
defaultCommandTimeout: 20000,
requestTimeout: 20000,
responseTimeout: 20000,
pageLoadTimeout: 30000,
specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'cypress/support/e2e.js',
// Retry failed tests once in CI
retries: {
runMode: 1,
openMode: 0,
},
setupNodeEvents(on, config) {
// Pass CI environment variable to Cypress as a boolean
config.env.CI = process.env.CI === 'true' || process.env.CI === '1';

return config;
},
},
});
7 changes: 0 additions & 7 deletions cypress.json

This file was deleted.

70 changes: 43 additions & 27 deletions cypress/integration/a11y.spec.js → cypress/e2e/a11y.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const elmExclude = '[style*="padding-left: calc(1ch + 6px)"]';
context('Accessibility (a11y)', () => {
context('Logged out', () => {
beforeEach(() => {
cy.server();
cy.route({
method: 'GET',
url: '/token-refresh',
status: 401,
response: { message: 'unauthorized' },
});
cy.intercept(
{ method: 'GET', url: '/token-refresh' },
{
statusCode: 401,
body: { message: 'unauthorized' },
},
);
});

it('overview', () => {
Expand All @@ -37,37 +37,53 @@ context('Accessibility (a11y)', () => {

context('Logged in', () => {
beforeEach(() => {
cy.server();
// overview page
cy.route('GET', '*api/v1/user*', 'fixture:favorites.json');
cy.intercept(
{ method: 'GET', url: '**/api/v1/user*' },
{ fixture: 'favorites.json' },
);
// source repos page
cy.route(
'GET',
'*api/v1/user/source/repos*',
'fixture:source_repositories.json',
cy.intercept(
{ method: 'GET', url: '**/api/v1/user/source/repos*' },
{
fixture: 'source_repositories.json',
},
);
// settings page
cy.route('GET', '*api/v1/repos/*/octocat', 'fixture:repository.json');
cy.intercept(
{ method: 'GET', url: '**/api/v1/repos/*/octocat' },
{
fixture: 'repository.json',
},
);
// repo and build page
cy.stubBuilds();
cy.stubBuild();
cy.stubStepsWithLogs();
// hooks page
cy.route('GET', '*api/v1/hooks/github/octocat*', 'fixture:hooks_5.json');
cy.route(
'GET',
'*api/v1/repos/*/octocat/builds/1*',
'fixture:build_success.json',
cy.intercept(
{ method: 'GET', url: '**/api/v1/hooks/github/octocat*' },
{
fixture: 'hooks_5.json',
},
);
cy.intercept(
{ method: 'GET', url: '**/api/v1/repos/*/octocat/builds/1*' },
{
fixture: 'build_success.json',
},
);
cy.route(
'GET',
'*api/v1/repos/*/octocat/builds/2*',
'fixture:build_failure.json',
cy.intercept(
{ method: 'GET', url: '**/api/v1/repos/*/octocat/builds/2*' },
{
fixture: 'build_failure.json',
},
);
cy.route(
'GET',
'*api/v1/repos/*/octocat/builds/3*',
'fixture:build_running.json',
cy.intercept(
{ method: 'GET', url: '**/api/v1/repos/*/octocat/builds/3*' },
{
fixture: 'build_running.json',
},
);
});

Expand Down
Loading
Loading