diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 00000000..b9747b99 --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,137 @@ +name: Build and Test + +on: + pull_request: + branches: + - master + +jobs: + build_module: + name: Build Module + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup + shell: pwsh + run: | + ./Tools/setup.ps1 + Invoke-Build -Task ShowInfo + - name: Build + shell: pwsh + run: | + Invoke-Build -Task Clean, Build + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Release + path: ./Release/ + + test_on_windows_v5: + name: Test Module on Windows (PS v5) + needs: build_module + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Download + uses: actions/download-artifact@v3 + with: + name: Release + path: ./Release/ + - name: Setup + shell: powershell + run: | + ./Tools/setup.ps1 + Invoke-Build -Task ShowInfo + - name: Test + shell: powershell + run: | + Invoke-Build -Task Test + + test_on_windows_v7: + name: Test Module on Windows (PS v7) + needs: build_module + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Download + uses: actions/download-artifact@v3 + with: + name: Release + path: ./Release/ + - name: Setup + shell: pwsh + run: | + ./Tools/setup.ps1 + Invoke-Build -Task ShowInfo + - name: Test + shell: pwsh + run: | + Invoke-Build -Task Test + + test_on_ubuntu: + name: Test Module on Ubuntu + needs: build_module + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Download + uses: actions/download-artifact@v3 + with: + name: Release + path: ./Release/ + - name: Setup + shell: pwsh + run: | + ./Tools/setup.ps1 + Invoke-Build -Task ShowInfo + - name: Test + shell: pwsh + run: | + Invoke-Build -Task Test + + test_on_macos: + name: Test Module on macOS + needs: build_module + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Download + uses: actions/download-artifact@v3 + with: + name: Release + path: ./Release/ + - name: Setup + shell: pwsh + run: | + ./Tools/setup.ps1 + Invoke-Build -Task ShowInfo + - name: Test + shell: pwsh + run: | + Invoke-Build -Task Test + + test_against_cloud: + env: + JiraURI: ${{ secrets.JiraURI }} + JiraUser: ${{ secrets.JiraUser }} + JiraPass: ${{ secrets.JiraPass }} + name: Test Module against Cloud Server + needs: build_module + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Download + uses: actions/download-artifact@v3 + with: + name: Release + path: ./Release/ + - name: Setup + shell: pwsh + run: | + ./Tools/setup.ps1 + Invoke-Build -Task ShowInfo + - name: Test + shell: pwsh + run: | + Invoke-Build -Task Test -Tag "Integration" -ExcludeTag "" + if: ${{ env.JiraURI != '' }} diff --git a/README.md b/README.md index 89652d3f..6ac368a2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ permalink: /module/JiraPS/ # [JiraPS](https://atlassianps.org/module/JiraPS) [![GitHub release](https://img.shields.io/github/release/AtlassianPS/JiraPS.svg?style=for-the-badge)](https://github.com/AtlassianPS/JiraPS/releases/latest) -[![Build Status](https://img.shields.io/vso/build/AtlassianPS/JiraPS/11/master.svg?style=for-the-badge)](https://dev.azure.com/AtlassianPS/JiraPS/_build/latest?definitionId=11) +[![Build Status](https://img.shields.io/github/actions/workflow/status/AtlassianPS/JiraPS/build_and_test.yml?style=for-the-badge)](https://github.com/AtlassianPS/JiraPS/actions/workflows/build_and_test.yml) [![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/JiraPS.svg?style=for-the-badge)](https://www.powershellgallery.com/packages/JiraPS) ![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge) @@ -61,18 +61,16 @@ Check out our guidelines on [Contributing] to our modules and documentation. ## Tested on -|Configuration|Status| -|-------------|------| -|Windows Powershell v3|| -|Windows Powershell v4|| -|Windows Powershell v5.1|[![Build Status](https://img.shields.io/vso/build/AtlassianPS/JiraPS/11/master.svg?style=for-the-badge)](https://dev.azure.com/AtlassianPS/JiraPS/_build/latest?definitionId=11)| -|Powershell Core (latest) on Windows|[![Build Status](https://img.shields.io/vso/build/AtlassianPS/JiraPS/11/master.svg?style=for-the-badge)](https://dev.azure.com/AtlassianPS/JiraPS/_build/latest?definitionId=11)| -|Powershell Core (latest) on Ubuntu|[![Build Status](https://img.shields.io/vso/build/AtlassianPS/JiraPS/11/master.svg?style=for-the-badge)](https://dev.azure.com/AtlassianPS/JiraPS/_build/latest?definitionId=11)| -|Powershell Core (latest) on MacOS|[![Build Status](https://img.shields.io/vso/build/AtlassianPS/JiraPS/11/master.svg?style=for-the-badge)](https://dev.azure.com/AtlassianPS/JiraPS/_build/latest?definitionId=11)| +* Windows Powershell v3 +* Windows Powershell v4 +* Windows Powershell v5.1 +* Powershell Core (latest) on Windows +* Powershell Core (latest) on Ubuntu +* Powershell Core (latest) on MacOS ## Acknowledgements -* Thanks to [replicaJunction] for getting this module on it's feet +* Thanks to [replicaJunction] for getting this module on its feet * Thanks to everyone ([Our Contributors](https://atlassianps.org/#people)) that helped with this module ## Useful links diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 56c1bff7..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,198 +0,0 @@ - -resources: -- repo: self - clean: true - -trigger: - branches: - include: - - master - - "*" - exclude: - - refs/tag/* - -phases: -- phase: Phase_1 - displayName: Build Module - - condition: succeeded() - queue: - name: Hosted VS2017 - - steps: - - powershell: | - . ./Tools/setup.ps1 - Invoke-Build -Task ShowInfo - displayName: Setup - - - powershell: 'Invoke-Build -Task Clean, Build' - displayName: Build - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: Built Module' - inputs: - PathtoPublish: Release - ArtifactName: Release - - -- phase: Phase_2 - displayName: Test Module on Windows (PSv5) - - dependsOn: Phase_1 - condition: succeeded() - queue: - name: Hosted VS2017 - - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifacts' - inputs: - artifactName: Release - downloadPath: '$(Build.SourcesDirectory)' - - - powershell: | - . ./Tools/setup.ps1 - Invoke-Build -Task ShowInfo - displayName: Setup - - - powershell: 'Invoke-Build -Task Test' - displayName: Test - - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/Test*.xml' - inputs: - testRunner: NUnit - testResultsFiles: '**/Test*.xml' - condition: succeededOrFailed() - - -- phase: Phase_3 - displayName: Test Module on Ubuntu - - dependsOn: Phase_1 - condition: succeeded() - queue: - name: Hosted Ubuntu 1604 - - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifacts' - inputs: - artifactName: Release - downloadPath: '$(Build.SourcesDirectory)' - - - - powershell: | - . ./Tools/setup.ps1 - Invoke-Build -Task ShowInfo - displayName: Setup - - - powershell: 'Invoke-Build -Task Test' - displayName: Test - - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/Test*.xml' - inputs: - testRunner: NUnit - testResultsFiles: '**/Test*.xml' - condition: succeededOrFailed() - - -- phase: Phase_4 - displayName: Test Module on macOS - - dependsOn: Phase_1 - condition: succeeded() - queue: - name: Hosted macOS - - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifacts' - inputs: - artifactName: Release - downloadPath: '$(Build.SourcesDirectory)' - - - powershell: | - . ./Tools/setup.ps1 - Invoke-Build -Task ShowInfo - displayName: Setup - - - powershell: 'Invoke-Build -Task Test' - displayName: Test - - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/Test*.xml' - inputs: - testRunner: NUnit - testResultsFiles: '**/Test*.xml' - condition: succeededOrFailed() - - -# Waiting for the agent to support pwsh: -# https://github.com/Microsoft/azure-pipelines-image-generation/issues/232 -# - phase: Phase_5 -# displayName: Test Module on Windows (PSv6) - -# dependsOn: Phase_1 -# condition: succeeded() -# queue: -# name: Hosted VS2017 - -# steps: -# - task: DownloadBuildArtifacts@0 -# displayName: 'Download Build Artifacts' -# inputs: -# artifactName: Release -# downloadPath: '$(Build.SourcesDirectory)' - -# - powershell: | -# . ./Tools/setup.ps1 -# Invoke-Build -Task ShowInfo -# displayName: Setup -# pwsh: true - -# - powershell: 'Invoke-Build -Task Test' -# displayName: Test -# pwsh: true - -# - task: PublishTestResults@2 -# displayName: 'Publish Test Results **/Test-*.xml' -# inputs: -# testRunner: NUnit -# testResultsFiles: '**/Test*.xml' -# condition: succeededOrFailed() - -- phase: Phase_6 - displayName: Test Module against Cloud Server - - dependsOn: Phase_1 - condition: succeeded() - queue: - name: Hosted VS2017 - - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifacts' - inputs: - artifactName: Release - downloadPath: '$(Build.SourcesDirectory)' - - - powershell: | - . ./Tools/setup.ps1 - Invoke-Build -Task ShowInfo - displayName: Setup - - - powershell: 'Invoke-Build -Task Test -Tag "Integration" -ExcludeTag ""' - env: - JiraURI: JiraURI - JiraUser: JiraUser - JiraPass: JiraPass - displayName: Test - - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/Test*.xml' - inputs: - testRunner: NUnit - testResultsFiles: '**/Test*.xml' - condition: succeededOrFailed()