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

24001 Updated CI/CD scripts #698

Merged
merged 2 commits into from
Oct 25, 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
23 changes: 10 additions & 13 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
name: BUSINESS FILINGS UI CD
name: Business Filings UI CD

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on:
push:
branches:
- main
- feature*
- hotfix*
workflow_dispatch:
inputs:
environment:
description: "Environment"
target:
description: "Deploy To"
required: true
type: choice
options:
- dev
- test
- sandbox
- prod
tagname:
description: "Specify a previous version (git tag) to deploy"
required: false
default: ""

jobs:
business-filings-cd:
uses: bcgov/bcregistry-sre/.github/workflows/ui-cd-node20.yaml@main
uses: bcgov/bcregistry-sre/.github/workflows/frontend-cd.yaml@main
with:
environment: ${{ inputs.environment }}
tagname: ${{ inputs.tagname }}
target: ${{ inputs.target }}
app_name: "business-filings-ui"
secrets:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, I don't think I need working_directory here.

Copy link
Collaborator Author

@severinbeauvais severinbeauvais Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, this app_name has to match a section name in 1Password (CD vault), ie:

image

APP_NAME: "business-filings"
OP_CONNECT_URL: ${{ secrets.OP_CONNECT_URL }}
OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }}
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
80 changes: 10 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,19 @@
name: BUSINESS FILINGS UI CI
name: Business Filings UI CI

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on:
pull_request:
types: [assigned, synchronize]
branches:
- main
- feature*
workflow_dispatch:
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved

defaults:
run:
shell: bash

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, no working_directory here.

jobs:
setup-job:
runs-on: ubuntu-20.04

if: github.repository == 'bcgov/business-filings-ui'

steps:
- uses: actions/checkout@v3
- run: "true"

linting:
needs: setup-job
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [20.5.1]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
make setup
- name: Linting
run: |
make lint

testing-coverage:
needs: setup-job
runs-on: ubuntu-20.04

strategy:
matrix:
node-version: [20.5.1]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
make setup
- name: Test with Vitest
id: test
run: |
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: codecov-business-filings
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN}}

build-check:
needs: setup-job
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: build to check strictness
id: build
run: |
make build-nc
business-filings-ui-ci:
uses: bcgov/bcregistry-sre/.github/workflows/frontend-ci.yaml@main
with:
node_version: "20.5.1"
app_name: "business-filings-ui"
77 changes: 0 additions & 77 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion codecov.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
codecov:
require_ci_to_pass: true
branch: master
branch: main
max_report_age: false

coverage:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"name": "business-filings-ui",
"version": "7.3.27",
"version": "7.4.0",
"private": true,
"appName": "Filings UI",
"sbcName": "SBC Common Components",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint . --ext .js,.ts,.vue",
"build-check": "vite build",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this, and perhaps some of the others, might be needed by scripts. Anyway, they don't hurt to have here.

"preview": "vite preview --port 8080",
"lint": "eslint . --ext js,ts,vue --no-fix",
"lint:fix": "eslint . --ext js,ts,vue --fix src",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want npm run lint to automatically fix issues, so I created "lint:fix" to do that.

This is different from auth-web where the default is to fix and there is "lint:nofix" instead.

"test": "vitest run",
"test:unit": "vitest run",
"test:coverage": "vitest run --coverage --silent"
"test:watch": "vitest watch",
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@babel/compat-data": "^7.21.5",
Expand Down
Loading