Skip to content

Commit

Permalink
Merge pull request #25 from criar-art/github-actions
Browse files Browse the repository at this point in the history
Enhance GitHub Actions Workflow with Unit and Module Test Steps
  • Loading branch information
lucasferreiralimax authored Oct 17, 2024
2 parents 9c9fac8 + 69cde4a commit f15bccb
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
- name: Install dependencies and build
run: npm ci && npm run build
- name: Run unit tests
run: npm run test -- --no-watch --no-progress --browsers=ChromeHeadless
- name: Run module tests
run: npm run test:module -- --no-watch --no-progress --browsers=ChromeHeadless
- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_UP_WINDOW_ANGULAR }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
- name: Install dependencies and build
run: npm ci && npm run build
- name: Run unit tests
run: npm run test -- --no-watch --no-progress --browsers=ChromeHeadless
- name: Run module tests
run: npm run test:module -- --no-watch --no-progress --browsers=ChromeHeadless
- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_UP_WINDOW_ANGULAR }}
Expand Down
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
"styles": [
"src/styles.scss"
],
"scripts": []
"scripts": [],
"karmaConfig": "karma.conf.js"
}
}
}
Expand Down
38 changes: 38 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// Additional Jasmine configuration options can be added here
},
},
jasmineHtmlReporter: {
suppressAll: true
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/up-window-angular-spa'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
browsers: ['ChromeHeadless'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--disable-gpu', '--disable-software-rasterizer']
}
},
restartOnFileChange: true
});
};

0 comments on commit f15bccb

Please sign in to comment.