This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
239 changed files
with
204,754 additions
and
208,916 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,76 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
jest: | ||
runs-on: ubuntu-latest | ||
permissions: read-all | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: install dependencies | ||
working-directory: ./next/news-aggregation | ||
run: sudo npm install | ||
- name: install jest globally | ||
run: sudo npm install -g jest | ||
- name: run tests | ||
working-directory: ./next/news-aggregation | ||
run: npm run test | ||
playwright: | ||
runs-on: ubuntu-latest | ||
permissions: read-all | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: install dependencies | ||
working-directory: ./next/news-aggregation | ||
run: sudo npm install | ||
- name: playright setup | ||
run: npx playwright install --with-deps | ||
- name: Tailscale | ||
uses: tailscale/github-action@v2 | ||
with: | ||
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | ||
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | ||
tags: tag:ci | ||
- name: Deploy to remote host | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.NEWNEWTITANIUM_IP }} | ||
username: ${{ secrets.NEWNEWTITANIUM_USER }} | ||
password: ${{ secrets.NEWNEWTITANIUM_PASS }} | ||
script: | | ||
cd /home/nial/TSI | ||
git pull | ||
npm install | ||
screen -S TSI -X quit | ||
screen -dmS TSI npm run dev | ||
- name: run tests | ||
working-directory: ./next/news-aggregation | ||
run: npx playwright test | ||
sonarqube: | ||
runs-on: ubuntu-latest | ||
permissions: read-all | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: install dependencies | ||
working-directory: ./next/news-aggregation | ||
run: sudo npm install | ||
- uses: sonarsource/sonarqube-scan-action@master | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
# If you wish to fail your job when the Quality Gate is red, uncomment the | ||
# following lines. This would typically be used to fail a deployment. | ||
# - uses: sonarsource/sonarqube-quality-gate-action@master | ||
# timeout-minutes: 5 | ||
# env: | ||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
jest: | ||
runs-on: ubuntu-latest | ||
permissions: read-all | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: install dependencies | ||
working-directory: ./next/news-aggregation | ||
run: sudo npm install | ||
- name: install jest globally | ||
run: sudo npm install -g jest | ||
- name: run tests | ||
working-directory: ./next/news-aggregation | ||
run: npm run test | ||
playwright: | ||
runs-on: ubuntu-latest | ||
permissions: read-all | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: install dependencies | ||
working-directory: ./next/news-aggregation | ||
run: sudo npm install | ||
- name: playright setup | ||
run: npx playwright install --with-deps | ||
- name: Tailscale | ||
uses: tailscale/github-action@v2 | ||
with: | ||
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | ||
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | ||
tags: tag:ci | ||
- name: Deploy to remote host | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.NEWNEWTITANIUM_IP }} | ||
username: ${{ secrets.NEWNEWTITANIUM_USER }} | ||
password: ${{ secrets.NEWNEWTITANIUM_PASS }} | ||
script: | | ||
cd /home/nial/TSI | ||
git pull | ||
npm install | ||
screen -S TSI -X quit | ||
screen -dmS TSI npm run dev | ||
- name: run tests | ||
working-directory: ./next/news-aggregation | ||
run: npx playwright test | ||
sonarqube: | ||
runs-on: ubuntu-latest | ||
permissions: read-all | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: install dependencies | ||
working-directory: ./next/news-aggregation | ||
run: sudo npm install | ||
- uses: sonarsource/sonarqube-scan-action@master | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
# If you wish to fail your job when the Quality Gate is red, uncomment the | ||
# following lines. This would typically be used to fail a deployment. | ||
# - uses: sonarsource/sonarqube-quality-gate-action@master | ||
# timeout-minutes: 5 | ||
# env: | ||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"sonarlint.connectedMode.project": { | ||
"connectionId": "macbook", | ||
"projectKey": "nmcc1212_TSI_AYwhmp3yeDOWGHdFx60w" | ||
}, | ||
"jest.rootPath": "next/news-aggregation" | ||
} | ||
"sonarlint.connectedMode.project": { | ||
"connectionId": "macbook", | ||
"projectKey": "nmcc1212_TSI_AYwhmp3yeDOWGHdFx60w" | ||
}, | ||
"jest.rootPath": "next/news-aggregation" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
// create a new text file or open it if it exists | ||
|
||
const fs = require('fs'); | ||
|
||
const fileName = 'newFile.txt'; | ||
const content = 'This is a new file'; | ||
const fs = require("fs"); | ||
|
||
const fileName = "newFile.txt"; | ||
const content = "This is a new file"; | ||
|
||
try { | ||
fs.writeFileSync(fileName, content); | ||
console.log('Saved Text!'); | ||
} | ||
catch (err) { | ||
console.error(err); | ||
fs.writeFileSync(fileName, content); | ||
console.log("Saved Text!"); | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
|
||
// Json file handling | ||
const jsFileName = 'newJsonFile.json'; | ||
const jsFileName = "newJsonFile.json"; | ||
const jsContent = '{"name":"John", "age":30, "city":"New York"}'; | ||
|
||
try { | ||
fs.writeFileSync(jsFileName, jsContent); | ||
console.log('Saved JSON!'); | ||
const data = fs.readFileSync(jsFileName, 'utf8'); | ||
console.log(data); | ||
} | ||
catch (err) { | ||
console.error(err); | ||
fs.writeFileSync(jsFileName, jsContent); | ||
console.log("Saved JSON!"); | ||
const data = fs.readFileSync(jsFileName, "utf8"); | ||
console.log(data); | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
|
||
// Read a json file | ||
const existingJsFile = 'vscode.json'; | ||
const existingJsFile = "vscode.json"; | ||
|
||
try { | ||
const data = fs.readFileSync(existingJsFile, 'utf8'); | ||
const obj = JSON.parse(data); | ||
console.log(JSON.stringify(obj, null, 2)); | ||
const data = fs.readFileSync(existingJsFile, "utf8"); | ||
const obj = JSON.parse(data); | ||
console.log(JSON.stringify(obj, null, 2)); | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
catch (err) { | ||
console.error(err); | ||
} |
Oops, something went wrong.