Skip to content

Commit

Permalink
build: bump Angular to 15 (#115)
Browse files Browse the repository at this point in the history
* build: bump Angular to 15

* PR remark

* cleanup workflow file

* Add first e2e test

* PR remark
  • Loading branch information
ndr-brt authored Oct 20, 2023
1 parent d80cc00 commit cb286d3
Show file tree
Hide file tree
Showing 17 changed files with 6,569 additions and 4,722 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,18 @@ on:
branches:
- 'main'

# Grant permissions to obtain federated identity credentials
# see https://docs.github.com/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure
permissions:
id-token: write
contents: read

jobs:

# Build runtime image in Azure Container Registry, tagged with the commit ID.
Build:
runs-on: ubuntu-latest
steps:
# Checkout code
- uses: actions/checkout@v4

# Build Docker runtime image
- name: 'Build image'
run: docker build -t data-dashboard .

# Run Docker container
- name: 'Run container'
run: docker run -p 8080:80 -d --rm --name data-dashboard data-dashboard

# Verify docker image
- name: 'Verify container'
run: |
curl -O https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: E2E

on:
push:
branches:
- main
pull_request:

jobs:
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: |
docker compose up -d
docker compose logs -f > logs &
- uses: actions/setup-node@v3
with:
node-version: '18.x'

- run: |
npm install
npm run cy
- name: Print docker logs
if: failure()
run: |
cat logs
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1.2mb"
"maximumWarning": "1.5mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
Expand Down
12 changes: 12 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:18080',
supportFile: false
},
env: {
consumerUrl: 'http//localhost:18080',
providerUrl: 'http//localhost:28080',
},
})
10 changes: 10 additions & 0 deletions cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe('end-to-end', () => {
it('should be accessible', () => {
const consumerUrl = Cypress.env('consumerUrl')
const providerUrl = Cypress.env('providerUrl')

cy.visit(consumerUrl);

cy.visit(providerUrl);
})
})
Loading

0 comments on commit cb286d3

Please sign in to comment.