Skip to content

Commit

Permalink
POC: Refactored CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
lipkau committed Dec 20, 2023
1 parent ebe77cb commit 855b4fe
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 249 deletions.
240 changes: 0 additions & 240 deletions .github/workflows/build_and_test.yml

This file was deleted.

109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/cache@v3
id: cacher
with:
path: "~/.local/share/powershell/Modules"
key: ${{ runner.os }}-PSModules

- name: Setup
shell: pwsh
run: |
./Tools/setup.ps1
Invoke-Build -Task ShowInfo
- name: Build
shell: pwsh
run: |
Invoke-Build -Task Clean, Build
- uses: actions/upload-artifact@v4
with:
name: Release
path: ./Release/

test:
needs: build

strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
shell: [pwsh, pwsh-preview]
include:
- os: windows-latest
shell: powershell

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: Release
path: ./Release/

- uses: actions/cache@v3
id: cacher
with:
path: "~/.local/share/powershell/Modules"
key: ${{ runner.os }}-PSModules

- name: Setup
run: ${{ matrix.shell }} -c ". ./Tools/setup.ps1; Invoke-Build -Task ShowInfo"

- name: Test
run: ${{ matrix.shell }} -c "Invoke-Build -Task Test"

- uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ matrix.shell }}-Unit-Tests
path: Test*.xml
if-no-files-found: error

# test_against_cloud:
# env:
# JiraURI: ${{ secrets.JiraURI }}
# JiraUser: ${{ secrets.JiraUser }}
# JiraPass: ${{ secrets.JiraPass }}
# name: Test Module against Cloud Server
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Download
# uses: actions/download-artifact@v4
# with:
# name: Release
# path: ./Release/
# - name: Setup PowerShell module cache
# id: cacher
# uses: actions/cache@v3
# with:
# path: "~/.local/share/powershell/Modules"
# key: ${{ runner.os }}-PSModules
# - 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 != '' }}
# - name: Upload test results
# uses: actions/upload-artifact@v3
# with:
# name: ${{ runner.os }}-Unit-Tests
# path: Test*.xml
# if: ${{ always() }}
9 changes: 0 additions & 9 deletions JiraPS.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,6 @@ task UpdateManifest GetNextVersion, {

}

# Synopsis: Create a ZIP file with this build
task Package Init, {
Assert-True { Test-Path "$env:BHBuildOutput\$env:BHProjectName" } "Missing files to package"

Remove-Item "$env:BHBuildOutput\$env:BHProjectName.zip" -ErrorAction SilentlyContinue
$null = Compress-Archive -Path "$env:BHBuildOutput\$env:BHProjectName" -DestinationPath "$env:BHBuildOutput\$env:BHProjectName.zip"
}
#endregion BuildRelease

#region Test
task Test Init, {
Assert-True { Test-Path $env:BHBuildOutput -PathType Container } "Release path must exist"
Expand Down

0 comments on commit 855b4fe

Please sign in to comment.