Skip to content

Commit

Permalink
Merge pull request #9 from microsoft/user/lemccomb/PreAlpha
Browse files Browse the repository at this point in the history
Port from internal ADO repo
  • Loading branch information
lemccomb authored Jul 7, 2023
2 parents d38bc02 + ef676c3 commit 45821f8
Show file tree
Hide file tree
Showing 120 changed files with 8,859 additions and 3,438 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/OpenPR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Automation when a new PR is opened
name: OpenPR

on:
pull_request_target:
types: [ opened, reopened ]

permissions:
pull-requests: write

jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
73 changes: 73 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "*" ]

jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
25 changes: 25 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'

on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: windows-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3

- name: NuGet Dependency Review
uses: actions/dependency-review-action@v3
with:
# Possible values: "critical", "high", "moderate", "low"
fail-on-severity: moderate
23 changes: 10 additions & 13 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
branches: [ "*" ]

jobs:
build:
name: build-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
os: [windows-latest] # Restore the others once it's working on Windows
#os: [windows-latest, ubuntu-latest, macOS-latest]

steps:
Expand All @@ -24,15 +24,12 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore CoseSignTool/CoseSignUnitTests/CoseSignUnitTests.csproj
- name: Build
run: dotnet build --no-restore CoseSignTool/CoseSignUnitTests/CoseSignUnitTests.csproj
#- name: Restore dependencies
# run: dotnet restore CoseSignTool/CoseSignTool.sln
#- name: Build
# run: dotnet build --no-restore CoseSignTool/CoseSignTool.sln
# run: dotnet build CoseSignTool/CoseSignTool.sln
- name: Test
run: |
if [ "$RUNNER_OS" != "Windows" ]; then
dotnet test --no-build --filter TestCategory!=WindowsOnly --verbosity normal CoseSignTool/CoseSignUnitTests/CoseSignUnitTests.csproj
else
dotnet test --no-build --verbosity normal CoseSignTool/CoseSignUnitTests/CoseSignUnitTests.csproj
fi
shell: bash
# run: dotnet test --no-build --verbosity normal CoseSignTool/CoseSignTool.sln
run: dotnet test --verbosity normal CoseSignTool/CoseSignTool.sln
shell: bash
Loading

0 comments on commit 45821f8

Please sign in to comment.