Skip to content

Commit

Permalink
fix: build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cybersokari committed Dec 7, 2024
1 parent ea417c5 commit e4b4383
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 12 deletions.
6 changes: 3 additions & 3 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ if [ ! -d "$MOUNT_POINT" ]; then
exit 1
fi

GITHUB_SUMMARY_FILE="/github/summary.txt"
if [ ! -f "$GITHUB_SUMMARY_FILE" ]; then
export GITHUB_SUMMARY_FILE
GITHUB_STEP_SUMMARY="/github/summary.txt"
if [ -f "$GITHUB_STEP_SUMMARY" ]; then
export GITHUB_STEP_SUMMARY
echo "Running on GitHub. Summary will be available in a bit"
fi

Expand Down
1 change: 1 addition & 0 deletions worker/app/notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Notifier {
const result = await web.chat.postMessage({
channel: cred.conversationId,
blocks: blocks,
text: 'Your Allure report is ready.'
});

console.log('Message sent: ', result.ts);
Expand Down
10 changes: 5 additions & 5 deletions worker/app/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fs from 'fs/promises'
import * as path from "node:path";
import util from "node:util";
const exec = util.promisify(require('child_process').exec)
import {REPORTS_DIR, websiteId} from "../index";
import {DEBUG, REPORTS_DIR, websiteId} from "../index";
import {StringBuilder} from "./string-builder";

export const getProjectIdFromCredentialsFile = async () => {
Expand Down Expand Up @@ -88,10 +88,10 @@ export async function changePermissionsRecursively(dirPath: string, mode: fsSync
}

export async function publishToFireBaseHosting(): Promise<string| undefined> {
// if (DEBUG) {
// console.warn('DEBUG=true: Skipping live deployment')
// return
// }
if (DEBUG) {
console.warn('DEBUG=true: Skipping live deployment')
return
}
const hosting = {
"hosting": {
"public": ".",
Expand Down
4 changes: 2 additions & 2 deletions worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ export function main(): void {
if (cloudStorage && keepRetires) {
await cloudStorage.uploadResults()
}
const summaryPath = process.env.GITHUB_SUMMARY_FILE
const summaryPath = process.env.GITHUB_STEP_SUMMARY
if(url && summaryPath){
notifier.printGithubSummary({mountedFilePath: summaryPath, url: url})
await notifier.printGithubSummary({mountedFilePath: summaryPath, url: url})
}
const token = process.env.SLACK_TOKEN;
const conversationId = process.env.SLACK_CHANNEL_ID;
Expand Down
2 changes: 1 addition & 1 deletion worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"lint": "eslint --ext .js,.ts .",
"build": "tsc",
"build:watch": "tsc --watch",
"test": "tsc && cucumber-js"
"test": "tsc --project test.tsconfig.json && npx cucumber-js"
},
"engines": {
"node": "22"
Expand Down
19 changes: 19 additions & 0 deletions worker/test.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},

"compileOnSave": true,
"include": [
"test"
],
"exclude": ["app"]
}
2 changes: 1 addition & 1 deletion worker/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"include": [
"index.ts",
"app/*.ts",
"test/step_definitions/*.ts"
],
"exclude": ["test"]
}

0 comments on commit e4b4383

Please sign in to comment.