Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up CI #275

Merged
merged 11 commits into from
Mar 18, 2024
Merged
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
51 changes: 51 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"prefix": "app",
"style": "kebab-case",
"type": "element"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "app",
"style": "camelCase",
"type": "attribute"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
55 changes: 0 additions & 55 deletions .github/workflows/cloudsql.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/hpo-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This is a basic workflow to help you get started with Actions

name: HPO-WEB Static Deployment

# Controls when the workflow will run
on: workflow_dispatch
env:
GCLOUD_BUCKET: ${{ secrets.GCLOUD_PUBLIC_BUCKET }}

jobs:
load:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCLOUD_SA_KEY }}'

- name: Setup Google Cloud CLI
uses: 'google-github-actions/setup-gcloud@v1'

- name: Configure Node
uses: actions/setup-node@v3
with:
node-version: 16.10.0
cache: 'npm'

- name: Lint, Test, Build
run: |
npm install
npm run lint
npm run testci
npm run buildProd --if-present

- name: Set Project Version
run: echo "PROJECT_VERSION=$(cat package.json | jq -r '.version')" >> "$GITHUB_ENV"

- name: Set Github Hash
run: echo "GIT_HASH=$(git rev-parse HEAD)" >> "$GITHUB_ENV"

- name: Deploy to GCS
run: |
gsutil -m cp -r dist/* "$GCLOUD_BUCKET/hpo-web-$PROJECT_VERSION-$GIT_HASH/"
gsutil -m rm -f "$GCLOUD_BUCKET/*" || true
gsutil -m rm -rf "$GCLOUD_BUCKET/assets/" || true
gsutil -m cp -r "$GCLOUD_BUCKET/hpo-web-$PROJECT_VERSION-$GIT_HASH/*" "$GCLOUD_BUCKET/"
24 changes: 11 additions & 13 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,14 @@
"src/favicon.ico"
]
}
}
}
},
"hpo-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "hpo:serve"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
Expand All @@ -137,6 +132,9 @@
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
3 changes: 1 addition & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
Expand All @@ -25,7 +24,7 @@ module.exports = function (config) {
level: 'log',
format: '%b %T: %m'
},
reporters: ['progress', 'kjhtml'],
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_ERROR,
Expand Down
Loading
Loading