diff --git a/.github/workflows/CI-PR.yml b/.github/workflows/CI-PR.yml deleted file mode 100644 index 5cc360e..0000000 --- a/.github/workflows/CI-PR.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CI-PR -on: - pull_request: - paths-ignore: - - .github/** - - README.md - - .all-contributorsrc - - CHANGELOG.md - - LICENSE -jobs: - Test: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: ${{ matrix.shell }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - shell: [pwsh, powershell] - exclude: - - os: ubuntu-latest - shell: powershell - - os: macos-latest - shell: powershell - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Run Pester Tests for PR - uses: zyborg/pester-tests-report@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - skip_check_run: true - tests_fail_step: true - report_name: TestResults_${{ runner.os }}_${{ matrix.shell }} - coverage_paths: src\private,src\public - coverage_report_name: CoverageResults_${{ runner.os }}_${{ matrix.shell }} \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 00dbfc2..4c3f40d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,17 +1,14 @@ name: CI on: push: + paths-ignore: + - '**.md' branches-ignore: - main - paths-ignore: - - .github/** - - README.md - - .all-contributorsrc - - CHANGELOG.md - - LICENSE - workflow_dispatch: + pull_request: jobs: Test: + if: github.event_name == 'push' || github.event.pull_request.head.repo.url != github.event.pull_request.base.repo.url runs-on: ${{ matrix.os }} defaults: run: @@ -27,62 +24,19 @@ jobs: - os: macos-latest shell: powershell steps: - - name: Set Variables - run: | - "BARE_REPOSITORY=$($env:GITHUB_REPOSITORY.split("/")[1])" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Checkout uses: actions/checkout@v4 - name: Run Pester Tests - uses: natescherer/pester-tests-report@master + uses: natescherer/pester-tests-report@combined with: github_token: ${{ secrets.GITHUB_TOKEN }} shell: ${{ matrix.shell }} tests_fail_step: true report_name: TestResults_${{ runner.os }}_${{ matrix.shell }} - gist_token: ${{ secrets.PESTER_GIST_TOKEN }} - gist_name: ${{ env.BARE_REPOSITORY }}_TestResults_${{ runner.os }}_${{ matrix.shell }}.md - gist_badge_label: ${{ runner.os }} ${{ matrix.shell }} coverage_paths: src\private,src\public coverage_report_name: CoverageResults_${{ runner.os }}_${{ matrix.shell }} - coverage_gist: true - coverage_gist_badge_label: Code Coverage - name: Upload to Codecov uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - TestRelease: - if: github.event_name != 'workflow_dispatch' - needs: Test - runs-on: ubuntu-latest - defaults: - run: - shell: pwsh - steps: - - name: Set Variables - run: | - "LOWERCASE_REPOSITORY=$($env:GITHUB_REPOSITORY.ToLower())" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.10.2 - with: - versionSpec: '5.x' - - name: Determine Version - id: gitversion - uses: gittools/actions/gitversion/execute@v0.10.2 - - name: Update PowerShell Metadata - uses: natescherer/update-powershell-metadata-action@v2 - with: - path: src - version: ${{ steps.gitversion.outputs.NuGetVersionV2 }} - copyright: (c) YYYY Nate Scherer. All rights reserved. - - name: Publish Module to Cloudsmith - uses: natescherer/publish-powershell-action@v1 - with: - token: ${{ secrets.CLOUDSMITH_KEY }} - target: nuget - nugetUrl: https://nuget.cloudsmith.io/${{ env.LOWERCASE_REPOSITORY }}/v3/index.json - path: src \ No newline at end of file + fail_ci_if_error: true \ No newline at end of file diff --git a/.github/workflows/dependabot.yml b/.github/workflows/DependabotAutoMerge.yml similarity index 82% rename from .github/workflows/dependabot.yml rename to .github/workflows/DependabotAutoMerge.yml index 62851f7..4e33b27 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/DependabotAutoMerge.yml @@ -1,5 +1,8 @@ -name: Dependabot auto-merge -on: pull_request +name: Dependabot Auto-Merge +on: + pull_request: + branches: + - 'dependabot/**' permissions: contents: write diff --git a/.github/workflows/TestRelease.yml b/.github/workflows/TestRelease.yml new file mode 100644 index 0000000..37a1af4 --- /dev/null +++ b/.github/workflows/TestRelease.yml @@ -0,0 +1,39 @@ +name: Test Release +on: + push: + branches: + - main +jobs: + Release: + runs-on: ubuntu-latest + defaults: + run: + shell: pwsh + steps: + - name: Set Variables + run: | + "LOWERCASE_REPOSITORY=$($env:GITHUB_REPOSITORY.ToLower())" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.10.2 + with: + versionSpec: '5.x' + - name: Determine Version + id: gitversion + uses: gittools/actions/gitversion/execute@v0.10.2 + - name: Update PowerShell Metadata + uses: natescherer/update-powershell-metadata-action@v2 + with: + path: src + version: ${{ steps.gitversion.outputs.NuGetVersionV2 }} + copyright: (c) YYYY Nate Scherer. All rights reserved. + - name: Publish Module to Cloudsmith + uses: natescherer/publish-powershell-action@v1 + with: + token: ${{ secrets.CLOUDSMITH_KEY }} + target: nuget + nugetUrl: https://nuget.cloudsmith.io/${{ env.LOWERCASE_REPOSITORY }}/v3/index.json + path: src \ No newline at end of file