Skip to content

Commit

Permalink
Restructure workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
natescherer committed Oct 28, 2023
1 parent 8628e51 commit 78088ce
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 91 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/CI-PR.yml

This file was deleted.

58 changes: 6 additions & 52 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- 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
fail_ci_if_error: true
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Dependabot auto-merge
on: pull_request
name: Dependabot Auto-Merge
on:
pull_request:
branches:
- 'dependabot/**'

permissions:
contents: write
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/TestRelease.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- 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

0 comments on commit 78088ce

Please sign in to comment.