@codyswann/lisa 1.52.2 → 1.52.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/config.d.ts +2 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +5 -0
- package/dist/core/lisa.js.map +1 -1
- package/expo/create-only/.github/workflows/ci.yml +2 -2
- package/expo/create-only/.github/workflows/deploy.yml +1 -1
- package/expo/deletions.json +8 -0
- package/nestjs/create-only/.github/workflows/ci.yml +1 -1
- package/nestjs/create-only/.github/workflows/deploy.yml +1 -1
- package/nestjs/deletions.json +7 -1
- package/package.json +1 -1
- package/typescript/copy-overwrite/.github/workflows/auto-update-pr-branches.yml +9 -30
- package/typescript/copy-overwrite/.github/workflows/claude-ci-auto-fix.yml +6 -131
- package/typescript/copy-overwrite/.github/workflows/claude-code-review-response.yml +9 -101
- package/typescript/copy-overwrite/.github/workflows/claude-deploy-auto-fix.yml +6 -129
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-code-complexity.yml +2 -118
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-test-coverage.yml +2 -115
- package/typescript/copy-overwrite/.github/workflows/claude-nightly-test-improvement.yml +4 -108
- package/typescript/copy-overwrite/.github/workflows/claude.yml +8 -38
- package/typescript/copy-overwrite/.github/workflows/reusable-auto-update-pr-branches.yml +63 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-ci-auto-fix.yml +167 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-code-review-response.yml +139 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-deploy-auto-fix.yml +165 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-nightly-code-complexity.yml +131 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-nightly-test-coverage.yml +128 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude-nightly-test-improvement.yml +127 -0
- package/typescript/copy-overwrite/.github/workflows/reusable-claude.yml +67 -0
- package/typescript/deletions.json +12 -0
- package/expo/copy-overwrite/.github/workflows/build.yml +0 -75
- package/expo/copy-overwrite/.github/workflows/lighthouse.yml +0 -88
- package/expo/copy-overwrite/.github/workflows/zap-baseline.yml +0 -107
- package/nestjs/copy-overwrite/.github/workflows/load-test.yml +0 -285
- package/nestjs/copy-overwrite/.github/workflows/zap-baseline.yml +0 -123
- package/typescript/copy-overwrite/.github/workflows/create-github-issue-on-failure.yml +0 -115
- package/typescript/copy-overwrite/.github/workflows/create-issue-on-failure.yml +0 -176
- package/typescript/copy-overwrite/.github/workflows/create-jira-issue-on-failure.yml +0 -197
- package/typescript/copy-overwrite/.github/workflows/create-sentry-issue-on-failure.yml +0 -269
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# This file is managed by Lisa.
|
|
2
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
+
|
|
4
|
+
name: Claude Nightly Test Coverage (Reusable)
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
workflow_call:
|
|
8
|
+
secrets:
|
|
9
|
+
CLAUDE_CODE_OAUTH_TOKEN:
|
|
10
|
+
required: false
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
improve-coverage:
|
|
14
|
+
if: vars.ENABLE_CLAUDE_NIGHTLY == 'true'
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
contents: write
|
|
18
|
+
pull-requests: write
|
|
19
|
+
issues: write
|
|
20
|
+
id-token: write
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout repository
|
|
23
|
+
uses: actions/checkout@v6
|
|
24
|
+
|
|
25
|
+
- name: Check for existing PR
|
|
26
|
+
id: check-pr
|
|
27
|
+
uses: actions/github-script@v7
|
|
28
|
+
with:
|
|
29
|
+
script: |
|
|
30
|
+
const pulls = await github.rest.pulls.list({
|
|
31
|
+
owner: context.repo.owner,
|
|
32
|
+
repo: context.repo.repo,
|
|
33
|
+
state: 'open',
|
|
34
|
+
per_page: 100,
|
|
35
|
+
});
|
|
36
|
+
const existing = pulls.data.find(pr =>
|
|
37
|
+
pr.head.ref.startsWith('claude/nightly-test-coverage-')
|
|
38
|
+
);
|
|
39
|
+
core.setOutput('has_existing_pr', existing ? 'true' : 'false');
|
|
40
|
+
if (existing) {
|
|
41
|
+
console.log(`Found existing PR: #${existing.number} - ${existing.title}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
- name: Read coverage thresholds
|
|
45
|
+
if: steps.check-pr.outputs.has_existing_pr != 'true'
|
|
46
|
+
id: thresholds
|
|
47
|
+
uses: actions/github-script@v7
|
|
48
|
+
with:
|
|
49
|
+
script: |
|
|
50
|
+
const fs = require('fs');
|
|
51
|
+
const path = 'jest.thresholds.json';
|
|
52
|
+
|
|
53
|
+
if (!fs.existsSync(path)) {
|
|
54
|
+
core.setOutput('all_at_target', 'true');
|
|
55
|
+
console.log('jest.thresholds.json not found, skipping.');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const thresholds = JSON.parse(fs.readFileSync(path, 'utf8'));
|
|
60
|
+
const global = thresholds.global || {};
|
|
61
|
+
const metrics = ['statements', 'branches', 'functions', 'lines'];
|
|
62
|
+
const target = 90;
|
|
63
|
+
const increment = 5;
|
|
64
|
+
|
|
65
|
+
const current = {};
|
|
66
|
+
const proposed = {};
|
|
67
|
+
const bumps = [];
|
|
68
|
+
|
|
69
|
+
for (const metric of metrics) {
|
|
70
|
+
const value = global[metric] ?? 0;
|
|
71
|
+
current[metric] = value;
|
|
72
|
+
if (value < target) {
|
|
73
|
+
const newValue = Math.min(value + increment, target);
|
|
74
|
+
proposed[metric] = newValue;
|
|
75
|
+
bumps.push(`${metric} ${value}% -> ${newValue}%`);
|
|
76
|
+
} else {
|
|
77
|
+
proposed[metric] = value;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (bumps.length === 0) {
|
|
82
|
+
core.setOutput('all_at_target', 'true');
|
|
83
|
+
console.log('All coverage metrics are already at or above 90%. Skipping.');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
core.setOutput('all_at_target', 'false');
|
|
88
|
+
core.setOutput('current', JSON.stringify(current));
|
|
89
|
+
core.setOutput('proposed', JSON.stringify(proposed));
|
|
90
|
+
core.setOutput('bumps', bumps.join(', '));
|
|
91
|
+
console.log(`Current thresholds: ${JSON.stringify(current)}`);
|
|
92
|
+
console.log(`Proposed thresholds: ${JSON.stringify(proposed)}`);
|
|
93
|
+
console.log(`Metrics to bump: ${bumps.join(', ')}`);
|
|
94
|
+
|
|
95
|
+
- name: Run Claude Code to improve coverage
|
|
96
|
+
if: |
|
|
97
|
+
steps.check-pr.outputs.has_existing_pr != 'true' &&
|
|
98
|
+
steps.thresholds.outputs.all_at_target != 'true'
|
|
99
|
+
uses: anthropics/claude-code-action@v1
|
|
100
|
+
with:
|
|
101
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
102
|
+
show_full_output: true
|
|
103
|
+
branch_prefix: claude/nightly-test-coverage-
|
|
104
|
+
prompt: |
|
|
105
|
+
Increase test coverage thresholds for this project.
|
|
106
|
+
|
|
107
|
+
Current coverage thresholds in jest.thresholds.json:
|
|
108
|
+
${{ steps.thresholds.outputs.current }}
|
|
109
|
+
|
|
110
|
+
Proposed new thresholds (each metric increased by 5%, capped at 90%):
|
|
111
|
+
${{ steps.thresholds.outputs.proposed }}
|
|
112
|
+
|
|
113
|
+
Metrics being bumped: ${{ steps.thresholds.outputs.bumps }}
|
|
114
|
+
|
|
115
|
+
Instructions:
|
|
116
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
117
|
+
2. Run the test coverage report to understand current coverage gaps
|
|
118
|
+
3. Write new tests to increase coverage enough to meet the proposed thresholds
|
|
119
|
+
4. Focus on the metrics being bumped — write tests that cover untested branches, statements, functions, and lines
|
|
120
|
+
5. Run `bun run test:cov` to verify the new thresholds pass
|
|
121
|
+
6. Update jest.thresholds.json with the proposed new threshold values
|
|
122
|
+
7. Run `bun run test:cov` again to confirm the updated thresholds pass
|
|
123
|
+
8. Commit all changes (new tests + updated jest.thresholds.json) with conventional commit messages
|
|
124
|
+
9. Create a PR with `gh pr create` with a title like "Increase test coverage: ${{ steps.thresholds.outputs.bumps }}" summarizing coverage improvements
|
|
125
|
+
claude_args: |
|
|
126
|
+
--allowedTools "Edit,MultiEdit,Write,Read,Glob,Grep,Bash(*),Skill(*)"
|
|
127
|
+
--max-turns 30
|
|
128
|
+
--system-prompt "You are improving test coverage to meet higher thresholds. Read CLAUDE.md for project rules. Follow TDD practices. Write tests that verify behavior, not implementation details. Include edge cases and error paths. You must update jest.thresholds.json with the new values after tests pass."
|
package/typescript/copy-overwrite/.github/workflows/reusable-claude-nightly-test-improvement.yml
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# This file is managed by Lisa.
|
|
2
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
+
|
|
4
|
+
name: Claude Nightly Test Improvement (Reusable)
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
workflow_call:
|
|
8
|
+
inputs:
|
|
9
|
+
mode:
|
|
10
|
+
description: 'Analysis mode (nightly or general)'
|
|
11
|
+
required: false
|
|
12
|
+
type: string
|
|
13
|
+
default: 'nightly'
|
|
14
|
+
secrets:
|
|
15
|
+
CLAUDE_CODE_OAUTH_TOKEN:
|
|
16
|
+
required: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
improve-tests:
|
|
20
|
+
if: vars.ENABLE_CLAUDE_NIGHTLY == 'true'
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: write
|
|
24
|
+
pull-requests: write
|
|
25
|
+
issues: write
|
|
26
|
+
id-token: write
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v6
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
|
|
33
|
+
- name: Determine mode
|
|
34
|
+
id: mode
|
|
35
|
+
run: echo "value=${{ inputs.mode || 'nightly' }}" >> "$GITHUB_OUTPUT"
|
|
36
|
+
|
|
37
|
+
- name: Detect changed files (nightly mode)
|
|
38
|
+
id: changes
|
|
39
|
+
if: steps.mode.outputs.value == 'nightly'
|
|
40
|
+
run: |
|
|
41
|
+
CHANGED_FILES=$(git log --since="24 hours ago" --name-only --pretty=format:"" -- '*.ts' '*.tsx' '*.js' '*.jsx' | sort -u | grep -v '^\s*$' || true)
|
|
42
|
+
if [ -z "$CHANGED_FILES" ]; then
|
|
43
|
+
echo "skip=true" >> "$GITHUB_OUTPUT"
|
|
44
|
+
echo "No source files changed in the last 24 hours."
|
|
45
|
+
else
|
|
46
|
+
echo "skip=false" >> "$GITHUB_OUTPUT"
|
|
47
|
+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
|
|
48
|
+
echo "files<<$EOF" >> "$GITHUB_OUTPUT"
|
|
49
|
+
echo "$CHANGED_FILES" >> "$GITHUB_OUTPUT"
|
|
50
|
+
echo "$EOF" >> "$GITHUB_OUTPUT"
|
|
51
|
+
echo "Changed files:"
|
|
52
|
+
echo "$CHANGED_FILES"
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
- name: Check for existing PR
|
|
56
|
+
if: steps.changes.outputs.skip != 'true'
|
|
57
|
+
id: check-pr
|
|
58
|
+
uses: actions/github-script@v7
|
|
59
|
+
with:
|
|
60
|
+
script: |
|
|
61
|
+
const pulls = await github.rest.pulls.list({
|
|
62
|
+
owner: context.repo.owner,
|
|
63
|
+
repo: context.repo.repo,
|
|
64
|
+
state: 'open',
|
|
65
|
+
per_page: 100,
|
|
66
|
+
});
|
|
67
|
+
const existing = pulls.data.find(pr =>
|
|
68
|
+
pr.head.ref.startsWith('claude/nightly-test-improvement-')
|
|
69
|
+
);
|
|
70
|
+
core.setOutput('has_existing_pr', existing ? 'true' : 'false');
|
|
71
|
+
if (existing) {
|
|
72
|
+
console.log(`Found existing PR: #${existing.number} - ${existing.title}`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
- name: Run Claude Code to improve tests (nightly)
|
|
76
|
+
if: |
|
|
77
|
+
steps.mode.outputs.value == 'nightly' &&
|
|
78
|
+
steps.changes.outputs.skip != 'true' &&
|
|
79
|
+
steps.check-pr.outputs.has_existing_pr != 'true'
|
|
80
|
+
uses: anthropics/claude-code-action@v1
|
|
81
|
+
with:
|
|
82
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
83
|
+
show_full_output: true
|
|
84
|
+
branch_prefix: claude/nightly-test-improvement-
|
|
85
|
+
prompt: |
|
|
86
|
+
Analyze and improve tests related to recently changed source files.
|
|
87
|
+
|
|
88
|
+
The following source files were changed in the last 24 hours:
|
|
89
|
+
${{ steps.changes.outputs.files }}
|
|
90
|
+
|
|
91
|
+
Instructions:
|
|
92
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
93
|
+
2. For each changed source file above, find its corresponding test file(s)
|
|
94
|
+
3. Analyze those test files for: missing edge cases, weak assertions (toBeTruthy instead of specific values), missing error path coverage, tests that test implementation rather than behavior
|
|
95
|
+
4. Improve the test files with the most impactful changes
|
|
96
|
+
5. Run the full test suite to verify all tests pass
|
|
97
|
+
6. Commit changes with conventional commit messages
|
|
98
|
+
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
99
|
+
claude_args: |
|
|
100
|
+
--allowedTools "Edit,MultiEdit,Write,Read,Glob,Grep,Bash(*),Skill(*)"
|
|
101
|
+
--max-turns 30
|
|
102
|
+
--system-prompt "You are improving test quality for recently changed files. Read CLAUDE.md for project rules. Follow TDD practices. Focus on making tests more robust, not just adding more tests. Prefer behavior testing over implementation testing."
|
|
103
|
+
|
|
104
|
+
- name: Run Claude Code to improve tests (general)
|
|
105
|
+
if: |
|
|
106
|
+
steps.mode.outputs.value == 'general' &&
|
|
107
|
+
steps.check-pr.outputs.has_existing_pr != 'true'
|
|
108
|
+
uses: anthropics/claude-code-action@v1
|
|
109
|
+
with:
|
|
110
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
111
|
+
show_full_output: true
|
|
112
|
+
branch_prefix: claude/nightly-test-improvement-
|
|
113
|
+
prompt: |
|
|
114
|
+
Analyze the test suite and improve test quality.
|
|
115
|
+
|
|
116
|
+
Instructions:
|
|
117
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
118
|
+
2. Scan the test files to find weak, brittle, or poorly-written tests
|
|
119
|
+
3. Look for: missing edge cases, weak assertions (toBeTruthy instead of specific values), missing error path coverage, tests that test implementation rather than behavior
|
|
120
|
+
4. Improve 3-5 test files with the most impactful changes
|
|
121
|
+
5. Run the full test suite to verify all tests pass
|
|
122
|
+
6. Commit changes with conventional commit messages
|
|
123
|
+
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
124
|
+
claude_args: |
|
|
125
|
+
--allowedTools "Edit,MultiEdit,Write,Read,Glob,Grep,Bash(*),Skill(*)"
|
|
126
|
+
--max-turns 30
|
|
127
|
+
--system-prompt "You are improving test quality. Read CLAUDE.md for project rules. Follow TDD practices. Focus on making tests more robust, not just adding more tests. Prefer behavior testing over implementation testing."
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# This file is managed by Lisa.
|
|
2
|
+
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
+
|
|
4
|
+
name: Claude Code (Reusable)
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
workflow_call:
|
|
8
|
+
inputs:
|
|
9
|
+
event_name:
|
|
10
|
+
description: 'The event that triggered the workflow'
|
|
11
|
+
required: true
|
|
12
|
+
type: string
|
|
13
|
+
comment_body:
|
|
14
|
+
description: 'Body of the comment (for issue_comment and PR review comment events)'
|
|
15
|
+
required: false
|
|
16
|
+
type: string
|
|
17
|
+
default: ''
|
|
18
|
+
review_body:
|
|
19
|
+
description: 'Body of the review (for pull_request_review events)'
|
|
20
|
+
required: false
|
|
21
|
+
type: string
|
|
22
|
+
default: ''
|
|
23
|
+
issue_body:
|
|
24
|
+
description: 'Body of the issue (for issues events)'
|
|
25
|
+
required: false
|
|
26
|
+
type: string
|
|
27
|
+
default: ''
|
|
28
|
+
issue_title:
|
|
29
|
+
description: 'Title of the issue (for issues events)'
|
|
30
|
+
required: false
|
|
31
|
+
type: string
|
|
32
|
+
default: ''
|
|
33
|
+
secrets:
|
|
34
|
+
CLAUDE_CODE_OAUTH_TOKEN:
|
|
35
|
+
required: false
|
|
36
|
+
|
|
37
|
+
jobs:
|
|
38
|
+
claude:
|
|
39
|
+
if: |
|
|
40
|
+
(inputs.event_name == 'issue_comment' && contains(inputs.comment_body, '@claude')) ||
|
|
41
|
+
(inputs.event_name == 'pull_request_review_comment' && contains(inputs.comment_body, '@claude')) ||
|
|
42
|
+
(inputs.event_name == 'pull_request_review' && contains(inputs.review_body, '@claude')) ||
|
|
43
|
+
(inputs.event_name == 'issues' && (contains(inputs.issue_body, '@claude') || contains(inputs.issue_title, '@claude')))
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
permissions:
|
|
46
|
+
contents: write
|
|
47
|
+
pull-requests: write
|
|
48
|
+
issues: write
|
|
49
|
+
id-token: write
|
|
50
|
+
actions: read
|
|
51
|
+
steps:
|
|
52
|
+
- name: Checkout repository
|
|
53
|
+
uses: actions/checkout@v6
|
|
54
|
+
with:
|
|
55
|
+
fetch-depth: 1
|
|
56
|
+
|
|
57
|
+
- name: Run Claude Code
|
|
58
|
+
id: claude
|
|
59
|
+
uses: anthropics/claude-code-action@v1
|
|
60
|
+
with:
|
|
61
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
62
|
+
show_full_output: true
|
|
63
|
+
additional_permissions: |
|
|
64
|
+
actions: read
|
|
65
|
+
claude_args: |
|
|
66
|
+
--allowedTools "Edit,MultiEdit,Write,Read,Glob,Grep,Bash(*),Skill(*)"
|
|
67
|
+
--system-prompt "Follow our coding standards. Ensure all new code has tests. Look at package.json for scripts. Make sure all quality checks pass before committing. Reuse existing helper functions when possible."
|
|
@@ -20,6 +20,18 @@
|
|
|
20
20
|
"tsconfig.base.json",
|
|
21
21
|
"tsconfig.typescript.json",
|
|
22
22
|
".github/workflows/quality.yml",
|
|
23
|
+
".github/workflows/release.yml",
|
|
24
|
+
".github/workflows/create-issue-on-failure.yml",
|
|
25
|
+
".github/workflows/create-github-issue-on-failure.yml",
|
|
26
|
+
".github/workflows/create-jira-issue-on-failure.yml",
|
|
27
|
+
".github/workflows/create-sentry-issue-on-failure.yml"
|
|
28
|
+
],
|
|
29
|
+
"keep": [
|
|
30
|
+
".github/workflows/create-issue-on-failure.yml",
|
|
31
|
+
".github/workflows/create-github-issue-on-failure.yml",
|
|
32
|
+
".github/workflows/create-jira-issue-on-failure.yml",
|
|
33
|
+
".github/workflows/create-sentry-issue-on-failure.yml",
|
|
34
|
+
".github/workflows/quality.yml",
|
|
23
35
|
".github/workflows/release.yml"
|
|
24
36
|
]
|
|
25
37
|
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
|
|
4
|
-
name: EAS Build
|
|
5
|
-
on:
|
|
6
|
-
workflow_dispatch:
|
|
7
|
-
inputs:
|
|
8
|
-
environment:
|
|
9
|
-
description: 'Environment to build for'
|
|
10
|
-
required: true
|
|
11
|
-
default: 'dev'
|
|
12
|
-
type: choice
|
|
13
|
-
options:
|
|
14
|
-
- dev
|
|
15
|
-
- staging
|
|
16
|
-
- main
|
|
17
|
-
workflow_call:
|
|
18
|
-
inputs:
|
|
19
|
-
environment:
|
|
20
|
-
description: 'Environment to build for'
|
|
21
|
-
required: true
|
|
22
|
-
type: string
|
|
23
|
-
secrets:
|
|
24
|
-
EXPO_TOKEN:
|
|
25
|
-
required: true
|
|
26
|
-
push:
|
|
27
|
-
branches:
|
|
28
|
-
- dev
|
|
29
|
-
- staging
|
|
30
|
-
- main
|
|
31
|
-
paths:
|
|
32
|
-
- app.config.ts # Only trigger builds if this file changes
|
|
33
|
-
|
|
34
|
-
jobs:
|
|
35
|
-
build:
|
|
36
|
-
name: Install and build
|
|
37
|
-
runs-on: ubuntu-latest
|
|
38
|
-
steps:
|
|
39
|
-
- uses: actions/checkout@v4
|
|
40
|
-
- uses: actions/setup-node@v4
|
|
41
|
-
with:
|
|
42
|
-
node-version: '22.21.1'
|
|
43
|
-
- name: 🍞 Setup Bun
|
|
44
|
-
uses: oven-sh/setup-bun@v2
|
|
45
|
-
with:
|
|
46
|
-
bun-version: '1.3.8'
|
|
47
|
-
- name: Setup Expo and EAS
|
|
48
|
-
uses: expo/expo-github-action@v8
|
|
49
|
-
with:
|
|
50
|
-
eas-version: latest
|
|
51
|
-
token: ${{ secrets.EXPO_TOKEN }}
|
|
52
|
-
- name: Install dependencies
|
|
53
|
-
run: bun install
|
|
54
|
-
- name: Determine Environment
|
|
55
|
-
id: env
|
|
56
|
-
run: |
|
|
57
|
-
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
|
58
|
-
echo "environment=${{ github.event.inputs.environment }}" >> $GITHUB_OUTPUT
|
|
59
|
-
elif [ "${{ github.event_name }}" == "workflow_call" ]; then
|
|
60
|
-
echo "environment=${{ inputs.environment }}" >> $GITHUB_OUTPUT
|
|
61
|
-
else
|
|
62
|
-
echo "environment=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
|
63
|
-
fi
|
|
64
|
-
- name: Build Dev Preview
|
|
65
|
-
if: steps.env.outputs.environment == 'dev'
|
|
66
|
-
run: eas build --platform all --non-interactive --no-wait --profile=dev-preview
|
|
67
|
-
- name: Build Dev
|
|
68
|
-
if: steps.env.outputs.environment == 'dev'
|
|
69
|
-
run: eas build --platform all --non-interactive --no-wait --profile=dev
|
|
70
|
-
- name: Build Staging
|
|
71
|
-
if: steps.env.outputs.environment == 'staging'
|
|
72
|
-
run: eas build --platform all --non-interactive --no-wait --profile=staging --auto-submit
|
|
73
|
-
- name: Build Production
|
|
74
|
-
if: steps.env.outputs.environment == 'main'
|
|
75
|
-
run: eas build --platform all --non-interactive --no-wait --profile=production --auto-submit
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
|
|
4
|
-
name: 💡 Lighthouse CI
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
workflow_call:
|
|
8
|
-
inputs:
|
|
9
|
-
node_version:
|
|
10
|
-
description: 'Node.js version to use'
|
|
11
|
-
required: false
|
|
12
|
-
default: '22.21.1'
|
|
13
|
-
type: string
|
|
14
|
-
package_manager:
|
|
15
|
-
description: 'Package manager to use (npm, yarn, or bun)'
|
|
16
|
-
required: false
|
|
17
|
-
default: 'yarn'
|
|
18
|
-
type: string
|
|
19
|
-
target_branch:
|
|
20
|
-
description: 'Target branch for the PR (used to determine environment)'
|
|
21
|
-
required: false
|
|
22
|
-
default: 'staging'
|
|
23
|
-
type: string
|
|
24
|
-
|
|
25
|
-
jobs:
|
|
26
|
-
lighthouse:
|
|
27
|
-
name: 💡 Performance Budget Check
|
|
28
|
-
runs-on: ubuntu-latest
|
|
29
|
-
timeout-minutes: 15
|
|
30
|
-
|
|
31
|
-
steps:
|
|
32
|
-
- name: 📥 Checkout repository
|
|
33
|
-
uses: actions/checkout@v4
|
|
34
|
-
|
|
35
|
-
- name: 🔧 Setup Node.js
|
|
36
|
-
uses: actions/setup-node@v4
|
|
37
|
-
with:
|
|
38
|
-
node-version: ${{ inputs.node_version }}
|
|
39
|
-
cache: ${{ inputs.package_manager != 'bun' && inputs.package_manager || '' }}
|
|
40
|
-
|
|
41
|
-
- name: 🍞 Setup Bun
|
|
42
|
-
if: inputs.package_manager == 'bun'
|
|
43
|
-
uses: oven-sh/setup-bun@v2
|
|
44
|
-
with:
|
|
45
|
-
bun-version: '1.3.8'
|
|
46
|
-
|
|
47
|
-
- name: 📦 Install dependencies
|
|
48
|
-
run: |
|
|
49
|
-
if [ "${{ inputs.package_manager }}" = "npm" ]; then
|
|
50
|
-
npm ci
|
|
51
|
-
elif [ "${{ inputs.package_manager }}" = "yarn" ]; then
|
|
52
|
-
yarn install --frozen-lockfile
|
|
53
|
-
elif [ "${{ inputs.package_manager }}" = "bun" ]; then
|
|
54
|
-
bun install --frozen-lockfile
|
|
55
|
-
fi
|
|
56
|
-
|
|
57
|
-
- name: 📋 Copy amplify file (if exists)
|
|
58
|
-
run: |
|
|
59
|
-
ENV="${{ inputs.target_branch }}"
|
|
60
|
-
if [ "$ENV" == "staging" ]; then
|
|
61
|
-
SOURCE_FILE="staging.aws-exports.js"
|
|
62
|
-
elif [ "$ENV" == "dev" ]; then
|
|
63
|
-
SOURCE_FILE="dev.aws-exports.js"
|
|
64
|
-
else
|
|
65
|
-
SOURCE_FILE="prod.aws-exports.js"
|
|
66
|
-
fi
|
|
67
|
-
if [ -f "$SOURCE_FILE" ]; then
|
|
68
|
-
cp "$SOURCE_FILE" aws-exports.js
|
|
69
|
-
echo "Copied $SOURCE_FILE to aws-exports.js"
|
|
70
|
-
else
|
|
71
|
-
echo "Skipping: $SOURCE_FILE does not exist"
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
- name: 🏗️ Build web export
|
|
75
|
-
run: ${{ inputs.package_manager }} run export:web
|
|
76
|
-
env:
|
|
77
|
-
TARGET_BRANCH: ${{ inputs.target_branch }}
|
|
78
|
-
|
|
79
|
-
- name: 💡 Run Lighthouse CI
|
|
80
|
-
run: ${{ inputs.package_manager }} run lighthouse:check
|
|
81
|
-
|
|
82
|
-
- name: 📊 Upload Lighthouse reports
|
|
83
|
-
uses: actions/upload-artifact@v4
|
|
84
|
-
if: always()
|
|
85
|
-
with:
|
|
86
|
-
name: lighthouse-reports
|
|
87
|
-
path: .lighthouseci/
|
|
88
|
-
retention-days: 30
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# This file is managed by Lisa.
|
|
2
|
-
# Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
3
|
-
|
|
4
|
-
name: ZAP Baseline Scan (Expo)
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
workflow_call:
|
|
8
|
-
inputs:
|
|
9
|
-
node_version:
|
|
10
|
-
description: 'Node.js version to use'
|
|
11
|
-
required: false
|
|
12
|
-
default: '22.21.1'
|
|
13
|
-
type: string
|
|
14
|
-
package_manager:
|
|
15
|
-
description: 'Package manager to use (npm, yarn, or bun)'
|
|
16
|
-
required: false
|
|
17
|
-
default: 'bun'
|
|
18
|
-
type: string
|
|
19
|
-
zap_target_url:
|
|
20
|
-
description: 'Override URL for ZAP to scan (default: http://localhost:3000)'
|
|
21
|
-
required: false
|
|
22
|
-
default: 'http://localhost:3000'
|
|
23
|
-
type: string
|
|
24
|
-
zap_rules_file:
|
|
25
|
-
description: 'Path to ZAP rules configuration file'
|
|
26
|
-
required: false
|
|
27
|
-
default: '.zap/baseline.conf'
|
|
28
|
-
type: string
|
|
29
|
-
|
|
30
|
-
jobs:
|
|
31
|
-
zap_baseline:
|
|
32
|
-
name: ZAP Baseline Scan
|
|
33
|
-
runs-on: ubuntu-latest
|
|
34
|
-
timeout-minutes: 20
|
|
35
|
-
|
|
36
|
-
steps:
|
|
37
|
-
- name: Checkout repository
|
|
38
|
-
uses: actions/checkout@v4
|
|
39
|
-
|
|
40
|
-
- name: Setup Node.js
|
|
41
|
-
uses: actions/setup-node@v4
|
|
42
|
-
with:
|
|
43
|
-
node-version: ${{ inputs.node_version }}
|
|
44
|
-
cache: ${{ inputs.package_manager != 'bun' && inputs.package_manager || '' }}
|
|
45
|
-
|
|
46
|
-
- name: Setup Bun
|
|
47
|
-
if: inputs.package_manager == 'bun'
|
|
48
|
-
uses: oven-sh/setup-bun@v2
|
|
49
|
-
with:
|
|
50
|
-
bun-version: '1.3.8'
|
|
51
|
-
|
|
52
|
-
- name: Install dependencies
|
|
53
|
-
run: |
|
|
54
|
-
if [ "${{ inputs.package_manager }}" = "npm" ]; then
|
|
55
|
-
npm ci
|
|
56
|
-
elif [ "${{ inputs.package_manager }}" = "yarn" ]; then
|
|
57
|
-
yarn install --frozen-lockfile
|
|
58
|
-
elif [ "${{ inputs.package_manager }}" = "bun" ]; then
|
|
59
|
-
bun install --frozen-lockfile
|
|
60
|
-
fi
|
|
61
|
-
|
|
62
|
-
- name: Build web export
|
|
63
|
-
run: npx expo export --platform web
|
|
64
|
-
|
|
65
|
-
- name: Start static server
|
|
66
|
-
run: |
|
|
67
|
-
npx serve dist -l 3000 &
|
|
68
|
-
SERVER_PID=$!
|
|
69
|
-
echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
|
|
70
|
-
sleep 5
|
|
71
|
-
curl -sf http://localhost:3000 > /dev/null || (echo "Static server failed to start" && exit 1)
|
|
72
|
-
|
|
73
|
-
- name: Check for ZAP rules file
|
|
74
|
-
id: check_rules
|
|
75
|
-
run: |
|
|
76
|
-
if [ -f "${{ inputs.zap_rules_file }}" ]; then
|
|
77
|
-
echo "has_rules=true" >> $GITHUB_OUTPUT
|
|
78
|
-
else
|
|
79
|
-
echo "has_rules=false" >> $GITHUB_OUTPUT
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
- name: Run ZAP baseline scan
|
|
83
|
-
uses: zaproxy/action-baseline@v0.14.0
|
|
84
|
-
with:
|
|
85
|
-
target: ${{ inputs.zap_target_url }}
|
|
86
|
-
rules_file_name: ${{ steps.check_rules.outputs.has_rules == 'true' && inputs.zap_rules_file || '' }}
|
|
87
|
-
fail_action: true
|
|
88
|
-
allow_issue_writing: false
|
|
89
|
-
artifact_name: 'zap-report-expo'
|
|
90
|
-
|
|
91
|
-
- name: Stop static server
|
|
92
|
-
if: always()
|
|
93
|
-
run: |
|
|
94
|
-
if [ -n "$SERVER_PID" ]; then
|
|
95
|
-
kill "$SERVER_PID" 2>/dev/null || true
|
|
96
|
-
fi
|
|
97
|
-
|
|
98
|
-
- name: Upload ZAP report
|
|
99
|
-
if: always()
|
|
100
|
-
uses: actions/upload-artifact@v4
|
|
101
|
-
with:
|
|
102
|
-
name: zap-baseline-report-expo-${{ github.run_id }}
|
|
103
|
-
path: |
|
|
104
|
-
zap-report.html
|
|
105
|
-
zap-report.json
|
|
106
|
-
zap-report.md
|
|
107
|
-
retention-days: 14
|