Skip to content

Commit

Permalink
Merge specialized PR workflows back into one configuration file (#2363)
Browse files Browse the repository at this point in the history
* Attempt to simply docs only CI runs

* fix embedded yaml hopefully

* fix embedded yaml strings

* fix variable subs

* fix output check

* use output

* no negate

* jobs => needs

* see if negate works

* remove -docs for test-linux

* format should need changeset

* make heavy integration tests dependend on unit tests

* undo negate again

* Move windows over to new checks

* pass secret explicitly since composite cannot inherit

* remove echo

* format needs to run on windows

* re-enable IIS and make it docs aware as well

* remove echo

* Apply suggestions from code review

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

* separate unit and integrations, since integrations currently has a rogue wait causing mayhem

* revert back to -docs.yml to follow established company wide patterns

* remove changeset composite action

* merge -iis and -windows

* fix yml indentation

* Update .github/workflows/test-windows.yml

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

---------

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
  • Loading branch information
Mpdreamz and v1v authored Jun 5, 2024
1 parent de2ff72 commit 5491bbb
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 148 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/bootstrap/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ inputs:
description: 'Install azure functions tool chain ("true" or "false")'
required: false
default: "false"
tc-cloud:
description: 'Bootstrap TestContainers Cloud (TOKEN or "false")'
required: false
default: "false"
outputs:
agent-version:
description: "The current agent version number"
value: ${{ steps.dotnet.outputs.agent-version }}
major-version:
description: "The current major version number, semver"
value: ${{ steps.dotnet.outputs.major-version }}


runs:
using: "composite"
Expand All @@ -27,7 +32,7 @@ runs:
run: |
git fetch --prune --unshallow --tags
git tag --list
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
Expand Down Expand Up @@ -56,10 +61,11 @@ runs:
# Setup git config
- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current

# install common dependencies
- name: Install common dependencies
uses: ./.github/workflows/install-dependencies
with:
rust: '${{ inputs.rust }}'
azure: '${{ inputs.azure }}'
tc-cloud: '${{ inputs.tc-cloud }}'
27 changes: 24 additions & 3 deletions .github/workflows/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ inputs:
required: false
default: "false"
azure:
description: 'Install azure functions tool chain ("true" or "false")'
required: false
default: "false"
description: 'Install azure functions tool chain ("true" or "false")'
required: false
default: "false"
tc-cloud:
description: 'Bootstrap TestContainers Cloud (TOKEN or "false")'
required: false
default: "false"

runs:
using: "composite"
Expand Down Expand Up @@ -55,3 +59,20 @@ runs:
shell: cmd
run: choco install azure-functions-core-tools -y --no-progress -r --version 4.0.4829

# TEST CONTAINERS CLOUD
# If no PR event or if a PR event that's caused by a non-fork and non dependabot actor
- name: Setup TestContainers Cloud Client
if: |
inputs.tc-cloud != 'false'
&& (github.event_name != 'pull_request'
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.fork == false
&& github.actor != 'dependabot[bot]'
)
)
uses: atomicjar/testcontainers-cloud-setup-action@c335bdbb570ec7c48f72c7d450c077f0a002293e # v1.3.0
with:
token: ${{ inputs.tc-cloud }}



57 changes: 41 additions & 16 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,65 @@ permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

defaults:
run:
shell: bash

env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages


# 'pack' & 'tests' are required checks in this workflow.

# To not burn unneeded CI cycles:
# - Our required checks will always succeed if doc only changes are detected.
# - all jobs depend on 'format' to not waste cycles on quickly fixable errors.

jobs:

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
- name: Format
run: ./build.sh format

#required step
pack:
runs-on: ubuntu-latest

needs: [ 'format' ]
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
with:
rust: 'true'

- name: Format
run: ./build.sh format

- name: Package
run: ./build.sh pack

#required step
tests:
runs-on: ubuntu-latest
needs: [ 'format' ]
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap

- name: 'Tests: Unit'
shell: bash
run: ./build.sh test --test-suite unit

- name: 'Tests: Integrations'
shell: bash
run: ./build.sh test --test-suite integrations

azure-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
if: ${{ false }}
#if: |
# github.event_name != 'pull_request'
Expand Down Expand Up @@ -91,7 +108,6 @@ jobs:
echo "AZURE_RESOURCE_GROUP_PREFIX=ci-dotnet-${GITHUB_RUN_ID}" >> ${GITHUB_ENV}
- name: 'Tests: Azure'
shell: bash
run: ./build.sh test --test-suite azure

- name: 'Teardown tests infra'
Expand All @@ -100,22 +116,32 @@ jobs:
for group in $(az group list --query "[?name | starts_with(@,'${{ env.AZURE_RESOURCE_GROUP_PREFIX }}')]" --out json | jq .[].name --raw-output); do
az group delete --name "${group}" --no-wait --yes
done
integration-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap

- name: 'Tests: Integrations'
run: ./build.sh test --test-suite integrations

startup-hook-tests:
runs-on: ubuntu-latest

needs: [ 'format', 'tests' ]
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap

- name: 'Tests: StartupHooks'
shell: bash
run: ./build.sh test --test-suite startuphooks

profiler-tests:
runs-on: ubuntu-latest

needs: [ 'format', 'tests' ]
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
Expand All @@ -125,7 +151,6 @@ jobs:
rust: 'true'

- name: 'Tests: Profiler'
shell: bash
run: ./build.sh test --test-suite profiler

- name: Build Profiler Docker Image
Expand Down
110 changes: 0 additions & 110 deletions .github/workflows/test-windows-iis.yml

This file was deleted.

Loading

0 comments on commit 5491bbb

Please sign in to comment.