Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package workflow #491

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 0 additions & 206 deletions .github/workflows/build_and_test.yml

This file was deleted.

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

on: [pull_request]

defaults:
run:
shell: pwsh

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
run: |
./Tools/setup.ps1
Invoke-Build -Task ShowInfo

- name: Build
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]
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
if: ${{ always() }}

# 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:
# ...
# - name: Test
# run: |
# Invoke-Build -Task Test -Tag "Integration" -ExcludeTag ""
# if: ${{ env.JiraURI != '' }}
# ...
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
branches:
- feature/package-artifact # TODO: what should be a trigger?
workflow_dispatch:

defaults:
run:
shell: pwsh

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4 # TODO: this file is not available, as it's an artefact from another pipeline
# https://github.com/actions/download-artifact#download-artifacts-from-other-workflow-runs-or-repositories
with:
name: Release
path: ./Release/

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

- name: Setup
run: |
./Tools/setup.ps1
Invoke-Build -Task ShowInfo

- name: Deploy
env:
NUGET_API_KEY: ${{ secrets.shhh }} # TODO: this is not the correct secret yet.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Invoke-Build -Task Deploy
Write-Warning "SKIPPING: Invoke-Build -Task Deploy"
Loading