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

Run formatting scripts during PR builds #124

Merged
merged 9 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from 8 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
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: copilot-build
name: copilot-build-backend

on:
pull_request:
branches: ["main"]
workflow_call:
outputs:
artifact:
description: "The name of the uploaded artifact."
value: ${{jobs.web-api.outputs.artifact}}
value: ${{jobs.webapi.outputs.artifact}}

permissions:
contents: read

jobs:
web-api:
webapi:
strategy:
fail-fast: false
matrix:
Expand All @@ -33,7 +35,12 @@ jobs:

- name: Package Copilot Chat WebAPI
run: |
deploy\package-webapi.ps1 -Configuration Release -DotnetFramework net6.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\deploy
scripts\deploy\package-webapi.ps1 -Configuration Release -DotnetFramework net6.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\scripts\deploy

- name: Check formatting of Copilot Chat WebAPI
run: |
cd webapi/
dotnet format --verify-no-changes --verbosity diagnostic

- name: Set version tag
id: versiontag
Expand All @@ -46,7 +53,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: copilotchat-webapi-${{ steps.versiontag.outputs.versiontag }}
path: ${{ github.workspace }}\deploy\out\webapi.zip
path: ${{ github.workspace }}\scripts\deploy\out\webapi.zip

- name: "Set outputs"
id: artifactoutput
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/copilot-build-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: copilot-build-frontend

on:
workflow_dispatch:
pull_request:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
webapp:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"
cache-dependency-path: "webapp/yarn.lock"

- name: Run yarn install, yarn build, & yarn format
run: |
#!/bin/bash
set -e # exit with nonzero exit code if anything fails
echo "Running yarn install, yarn build, & yarn format"
yarn install --frozen-lockfile # install dependencies and ensure lockfile is unchanged.
yarn build # run build script
yarn format # run format script
working-directory: webapp
55 changes: 0 additions & 55 deletions .github/workflows/copilot-chat-package.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/copilot-deploy-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ permissions:
contents: read

jobs:
web-api:
webapi:
environment: ${{inputs.ENVIRONMENT}}
permissions:
id-token: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/copilot-deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: copilot-deploy-backend
name: copilot-deploy-frontend

on:
workflow_call:
Expand All @@ -23,7 +23,7 @@ permissions:
contents: read

jobs:
web-app:
webapp:
environment: ${{inputs.ENVIRONMENT}}
permissions:
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-deploy-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:

jobs:
build:
uses: ./.github/workflows/copilot-build.yml
uses: ./.github/workflows/copilot-build-backend.yml

int:
needs: build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
contents: read

jobs:
test:
e2e:
defaults:
run:
working-directory: webapp
Expand Down
70 changes: 0 additions & 70 deletions .github/workflows/node-pr.yml

This file was deleted.

Loading