From 27df29e2a6d4d72c7e8b2f0a1fc9001be1df2249 Mon Sep 17 00:00:00 2001 From: David Justo Date: Thu, 11 Jul 2024 11:58:39 -0700 Subject: [PATCH] experiments --- .github/workflows/build.yml | 13 ++++++++----- .github/workflows/codeQL.yml | 13 ++++++++++--- .github/workflows/test.yml | 10 ++++++++-- .github/workflows/validate_pr.yml | 30 ++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/validate_pr.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a8b5a94c..a8cdcb2f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ name: Build on: - workflow_call: # this means this runs only when called in another workflow + workflow_call: # allows to be invoked as part of a larger workflow workflow_dispatch: # allows for the workflow to run manually see: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow env: @@ -33,8 +33,11 @@ jobs: with: dotnet-version: '3.1.x' - - name: Restore dependencies - run: dotnet restore $solution - - name: Build - run: dotnet build $solution #--configuration $config #--no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:ContinuousIntegrationBuild=true \ No newline at end of file + run: dotnet build $solution -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:ContinuousIntegrationBuild=true + + - name: Upload built-code # allows next job to consume built project + uses: actions/upload-artifact@v2 + with: + name: built-code + path: ./ \ No newline at end of file diff --git a/.github/workflows/codeQL.yml b/.github/workflows/codeQL.yml index 831755ea4..c72a41f16 100644 --- a/.github/workflows/codeQL.yml +++ b/.github/workflows/codeQL.yml @@ -8,9 +8,10 @@ on: push: branches: [ "main" ] pull_request: - branches: [ "main", "feature/**" ] + branches: [ "main"] schedule: - cron: '0 0 * * 1' # Weekly Monday run, needed for weekly reports + workflow_call: # allows to be invoked as part of a larger workflow workflow_dispatch: # allows for the workflow to run manually see: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow env: @@ -40,8 +41,14 @@ jobs: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - - name: Checkout repository - uses: actions/checkout@v3 + # - name: Checkout repository + # uses: actions/checkout@v3 + + - name: Download built-code + uses: actions/download-artifact@v2 + with: + name: build-artifacts + path: ./ # This path will match the upload path # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54fa5d5a2..9827d956d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,9 +20,15 @@ jobs: needs: invoke-build-workflow # Can only test after build completes steps: - - uses: actions/checkout@v3 + # - uses: actions/checkout@v3 + # with: + # submodules: true + + - name: Download built-code + uses: actions/download-artifact@v2 with: - submodules: true + name: build-artifacts + path: ./ # This path will match the upload path - name: Set up Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/validate_pr.yml b/.github/workflows/validate_pr.yml new file mode 100644 index 000000000..e6894da57 --- /dev/null +++ b/.github/workflows/validate_pr.yml @@ -0,0 +1,30 @@ +# name: Validate PR + +# on: +# pull_request: +# branches: +# - '**' # run on all pull requests +# paths-ignore: [ '**.md' ] +# workflow_dispatch: # allows for the workflow to run manually see: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow + +# jobs: + +# # Invoke build workflow and install azurite may run in parallel +# invoke-build-workflow: # Call re-useable build workflow +# uses: ./.github/workflows/build.yml + +# install-azurite: +# runs-on: windows-latest +# steps: +# - uses: actions/checkout@v3 +# with: +# submodules: true + +# - name: Set up Node.js +# uses: actions/setup-node@v3 +# with: +# node-version: '16.x' + +# - name: Install Azurite +# run: npm install -g azurite +