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

[ODS-6236] GitHub Actions for 5x #983

Merged
merged 19 commits into from
Feb 29, 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
85 changes: 85 additions & 0 deletions .github/workflows/CodeQL Security Scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.

name: CodeQL Security Scan Pull request

on:
pull_request:
branches: [main-5x, 'b-v*-patch*','feature-*']
push:
branches: [main-5x, 'b-v*-patch*','feature-*']

env:
INFORMATIONAL_VERSION: "5.4"
BUILD_INCREMENTER: "1"
CONFIGURATION: "Release"
HEAD_REF: ${{ GITHUB.HEAD_REF }}
REF_NAME: ${{ GITHUB.REF_NAME }}
REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }}

jobs:
analyze:
name: Analyze Code
runs-on: windows-latest

permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false

steps:
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: 3.1.x
- name: Checkout Ed-Fi-ODS-Implementation
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation
path: Ed-Fi-ODS-Implementation/

- name: Is pull request branch exists in Ed-Fi-ODS-Implementation
working-directory: ./Ed-Fi-ODS-Implementation/
shell: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "."

- name: Checkout Ed-Fi-ODS
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
path: Ed-Fi-ODS/

- name: Is pull request branch exists in Ed-Fi-ODS
working-directory: ./Ed-Fi-ODS-Implementation/
shell: pwsh
run: |
.\build.githubactions.ps1 CheckoutBranch -RelativeRepoPath "../Ed-Fi-ODS"

- name: Initialize CodeQL
uses: github/codeql-action/init@df32e399139a3050671466d7d9b3cbacc1cfd034 # v2.15.2
with:
languages: 'csharp'

- name: CodeGen
working-directory: ./Ed-Fi-ODS-Implementation/
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$PSVersionTable
. $env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Initialize-PowershellForDevelopment.ps1
Invoke-CodeGen -Engine SQLServer -RepositoryRoot $env:GITHUB_WORKSPACE

- name: build
shell: pwsh
working-directory: ./Ed-Fi-ODS-Implementation/
run: |
.\build.githubactions.ps1 build -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION}} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -Solution "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/Application/Ed-Fi-Ods.sln"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@df32e399139a3050671466d7d9b3cbacc1cfd034 # v2.15.2
38 changes: 38 additions & 0 deletions .github/workflows/Dependencies Security Scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.

name: Dependency Review Pull request

on:
pull_request:
branches: [main-5x, 'b-v*-patch*','feature-*']

env:
HEAD_REF: ${{ GITHUB.HEAD_REF }}
REF_NAME: ${{ GITHUB.REF_NAME }}
REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }}

jobs:
scan-actions:
name: Scan Actions
uses: ed-fi-alliance-oss/ed-fi-actions/.github/workflows/repository-scanner.yml@main

analyze-code:
name: Analyze Code Dependencies
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false

steps:
- name: Checkout Ed-Fi-ODS
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Dependency Review ("Dependabot on PR")
uses: actions/dependency-review-action@7bbfa034e752445ea40215fff1c3bf9597993d3f # v3.1.3
23 changes: 23 additions & 0 deletions .github/workflows/InitDev Implementation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Trigger InitDev workflows in Implementation repo

on:
pull_request:
branches: [main-5x, 'b-v*-patch*','feature-*']
workflow_dispatch:

env:
EDFI_ODS_IMP_TOKEN: ${{ secrets.REPO_DISPATCH_TOKEN }}

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Dispatch to Implementation repo
uses: peter-evans/repository-dispatch@11ba7d3f32dc7cc919d1c43f1fec1c05260c26b5 # v2
with:
token: ${{ env.EDFI_ODS_IMP_TOKEN }}
repository: Ed-Fi-Alliance-OSS/Ed-Fi-ODS-Implementation
event-type: triggered-from-ods-repo
client-payload: '{"branch": "${{ GITHUB.HEAD_REF }}"}'
35 changes: 35 additions & 0 deletions .github/workflows/Lib edFi.admin.dataaccess pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lib EdFi.Admin.DataAccess Pull request build and test

on:
workflow_dispatch:
pull_request:
branches: [main-5x, 'b-v*-patch*','feature-*']
paths:
- Application/EdFi.Admin.DataAccess/**/*
- tests/EdFi.Admin.DataAccess.UnitTests/**/*
- Application/EdFi.Common/**/*

env:
INFORMATIONAL_VERSION: "5.4"
BUILD_INCREMENTER: "1"
CONFIGURATION: "Release"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: 3.1.x
- name: build
run: |
.\build.githubactions.ps1 build -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION}} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -Solution "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.sln" -ProjectFile "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.csproj"
shell: pwsh
- name: Run Unit tests
run: |
.\build.githubactions.ps1 test -Configuration ${{ env.CONFIGURATION }} -Solution "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.sln" -ProjectFile "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.csproj"
shell: pwsh
49 changes: 49 additions & 0 deletions .github/workflows/Lib edFi.admin.dataaccess.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Lib EdFi.Admin.DataAccess

on:
workflow_dispatch:

env:
INFORMATIONAL_VERSION: "5.4"
BUILD_INCREMENTER: "1"
CONFIGURATION: "Release"
AZURE_ARTIFACT_URL: "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
AZURE_ARTIFACT_NUGET_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS : '{"endpointCredentials": [{"endpoint": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json","password": "${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}"}]}'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: 3.1.x
- name: build
run: |
.\build.githubactions.ps1 build -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION}} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -Solution "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.sln" -ProjectFile "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.csproj"
shell: pwsh
- name: Run Unit tests
run: |
.\build.githubactions.ps1 test -Configuration ${{ env.CONFIGURATION }} -Solution "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.sln" -ProjectFile "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.csproj"
shell: pwsh
- name: pack
run: |
.\build.githubactions.ps1 pack -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -Solution "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.sln" -ProjectFile "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.csproj" -PackageName "EdFi.Suite3.Admin.DataAccess"
shell: pwsh
- name: Install-credential-handler
run: iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
shell: pwsh
- name: publish
run: |
.\build.githubactions.ps1 publish -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -NuGetApiKey ${{ env.AZURE_ARTIFACT_NUGET_KEY }} -EdFiNuGetFeed ${{env.AZURE_ARTIFACT_URL}} -Solution "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.sln" -ProjectFile "Application/EdFi.Admin.DataAccess/EdFi.Admin.DataAccess.csproj" -PackageName "EdFi.Suite3.Admin.DataAccess"
shell: pwsh
- name: Upload EdFi.Suite3.Admin.DataAccess Artifacts
if: success()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: NugetPackages.Artifacts
path: ${{ github.workspace }}/NugetPackages/*.nupkg
31 changes: 31 additions & 0 deletions .github/workflows/Lib edFi.common pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lib EdFi.Common Pull request build and test

on:
workflow_dispatch:
pull_request:
branches: [main-5x, 'b-v*-patch*','feature-*']
paths:
- Application/EdFi.Common/**/*
- tests/EdFi.Common.UnitTests/**/*
- tests/EdFi.TestFixture/**/*

env:
INFORMATIONAL_VERSION: "5.4"
CONFIGURATION: "Release"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: build
run: |
.\build.githubactions.ps1 build -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION}} -BuildCounter ${{ github.run_number }} -Solution "Application/EdFi.Common/EdFi.Common.sln" -ProjectFile "Application/EdFi.Common/EdFi.Common.csproj"
shell: pwsh
- name: Run Unit tests
run: |
.\build.githubactions.ps1 test -Configuration ${{ env.CONFIGURATION }} -Solution "Application/EdFi.Common/EdFi.Common.sln" -ProjectFile "Application/EdFi.Common/EdFi.Common.csproj"
shell: pwsh
49 changes: 49 additions & 0 deletions .github/workflows/Lib edFi.common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Lib EdFi.Common

on:
workflow_dispatch:

env:
INFORMATIONAL_VERSION: "5.4"
BUILD_INCREMENTER: "1"
CONFIGURATION: "Release"
AZURE_ARTIFACT_URL: "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json"
AZURE_ARTIFACT_NUGET_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS : '{"endpointCredentials": [{"endpoint": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json","password": "${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}"}]}'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: 3.1.x
- name: build
run: |
.\build.githubactions.ps1 build -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION}} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -Solution "Application/EdFi.Common/EdFi.Common.sln" -ProjectFile "Application/EdFi.Common/EdFi.Common.csproj"
shell: pwsh
- name: Run Unit tests
run: |
.\build.githubactions.ps1 test -Configuration ${{ env.CONFIGURATION }} -Solution "Application/EdFi.Common/EdFi.Common.sln" -ProjectFile "Application/EdFi.Common/EdFi.Common.csproj"
shell: pwsh
- name: pack
run: |
.\build.githubactions.ps1 pack -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -Solution "Application/EdFi.Common/EdFi.Common.sln" -ProjectFile "Application/EdFi.Common/EdFi.Common.csproj" -PackageName "EdFi.Suite3.Common"
shell: pwsh
- name: Install-credential-handler
run: iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
shell: pwsh
- name: publish
run: |
.\build.githubactions.ps1 publish -InformationalVersion ${{ env.INFORMATIONAL_VERSION }} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -NuGetApiKey ${{ env.AZURE_ARTIFACT_NUGET_KEY }} -EdFiNuGetFeed ${{env.AZURE_ARTIFACT_URL}} -Solution "Application/EdFi.Common/EdFi.Common.sln" -ProjectFile "Application/EdFi.Common/EdFi.Common.csproj" -PackageName "EdFi.Suite3.Common"
shell: pwsh
- name: Upload EdFi.Common Artifacts
if: success()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: NugetPackages.Artifacts
path: ${{ github.workspace }}/NugetPackages/*.nupkg
32 changes: 32 additions & 0 deletions .github/workflows/Lib edFi.loadtools pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lib EdFi.LoadTools Pull request build and test

on:
pull_request:
branches: [main-5x, 'b-v*-patch*','feature-*']
paths:
- Utilities/DataLoading/**/*

env:
INFORMATIONAL_VERSION: "5.4"
BUILD_INCREMENTER: "1"
CONFIGURATION: "Release"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: 3.1.x
- name: build
run: |
.\build.githubactions.ps1 build -Configuration ${{ env.CONFIGURATION }} -InformationalVersion ${{ env.INFORMATIONAL_VERSION}} -BuildCounter ${{ github.run_number }} -BuildIncrementer ${{env.BUILD_INCREMENTER}} -Solution "Utilities/DataLoading/LoadTools.sln"
shell: pwsh
- name: Run Unit tests
run: |
.\build.githubactions.ps1 test -Configuration ${{ env.CONFIGURATION }} -Solution "Utilities/DataLoading/LoadTools.sln" -TestFilter "RunManually"
shell: pwsh
Loading
Loading