Skip to content

Commit

Permalink
Update build to use GitHub Actions #1696 (#2030)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite authored Feb 11, 2023
1 parent fef02ce commit 4b9cfc4
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 29 deletions.
26 changes: 14 additions & 12 deletions .azure-pipelines/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ variables:
# Use build number format, i.e. 1.20.0-B2202001
name: $(version)-B$(date:yyMM)$(rev:rrr)

trigger:
branches:
include:
- 'main'
- 'release/*'

pr:
branches:
include:
- 'main'
- 'release/*'
trigger: none
# trigger:
# branches:
# include:
# - 'main'
# - 'release/*'

pr: none
# pr:
# branches:
# include:
# - 'main'
# - 'release/*'

stages:

Expand All @@ -43,7 +45,7 @@ stages:
version: 6.x

# Install pipeline dependencies
- powershell: ./.azure-pipelines/pipeline-deps.ps1
- powershell: ./scripts/pipeline-deps.ps1
displayName: 'Install dependencies'

# Build module
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/jobs/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- task: PowerShell@2
inputs:
targetType: inline
script: ./.azure-pipelines/pipeline-deps.ps1
script: ./scripts/pipeline-deps.ps1
pwsh: ${{ parameters.pwsh }}
displayName: 'Install dependencies'

Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/jobs/testContainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:

# Install pipeline dependencies
- powershell: ./.azure-pipelines/pipeline-deps.ps1
- powershell: ./scripts/pipeline-deps.ps1
displayName: 'Install dependencies'

# Download module
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@

name: Build
on:
# push:
# branches: [ main, 'release/*' ]
# pull_request:
# branches: [ main, 'release/*' ]
push:
branches: [ main, 'release/*' ]
pull_request:
branches: [ main, 'release/*' ]
workflow_dispatch:

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

jobs:
Build:
build:
name: Build
runs-on: ubuntu-latest
permissions:
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Install dependencies
shell: pwsh
timeout-minutes: 3
run: ./.azure-pipelines/pipeline-deps.ps1
run: ./scripts/pipeline-deps.ps1

- name: Build module
shell: pwsh
Expand Down Expand Up @@ -70,10 +70,10 @@ jobs:
retention-days: 3
if-no-files-found: error

Test:
test:
name: Test (${{ matrix.rid }}-${{ matrix.shell }})
runs-on: ${{ matrix.os }}
needs: Build
needs: build
permissions:
contents: read

Expand Down Expand Up @@ -116,13 +116,13 @@ jobs:
name: Install dependencies (PowerShell)
shell: pwsh
timeout-minutes: 3
run: ./.azure-pipelines/pipeline-deps.ps1
run: ./scripts/pipeline-deps.ps1

- if: ${{ matrix.shell == 'powershell' }}
name: Install dependencies (Windows PowerShell)
shell: powershell
timeout-minutes: 3
run: ./.azure-pipelines/pipeline-deps.ps1
run: ./scripts/pipeline-deps.ps1

- name: Download module
uses: actions/download-artifact@v3
Expand All @@ -139,5 +139,5 @@ jobs:
- if: ${{ matrix.shell == 'powershell' }}
name: Test module (Windows PowerShell)
shell: powershell
timeout-minutes: 15
timeout-minutes: 30
run: Invoke-Build TestModule -Configuration Release -AssertStyle GitHubActions
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# NOTES:
# This workflow generates and published the documentation site https://azure.github.io/PSRule.Rules.Azure/.

name: Build and deploy docs
name: Docs
on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# NOTES:
# Automatically updates provider data stored in data/ with the latest versions.

name: BumpProviders
name: Providers

on:
schedule:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
# Issues with open ended labels are automatically closed if no activity occurs.
# Issues are marked stale after 14 days, then closed after a further 7 days.

name: 'Close stale issues'
name: Stale
on:
schedule:
- cron: '30 1 * * *' # At 1:30 AM, daily

jobs:
stale:
runs-on: ubuntu-latest
name: Close stale issues
permissions:
issues: write
pull-requests: write
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Note:
# This manually builds the project locally

. ./.azure-pipelines/pipeline-deps.ps1
. ./scripts/pipeline-deps.ps1
Invoke-Build Test -AssertStyle Client

Write-Host 'If no build errors occurred. The module has been saved to out/modules/PSRule.Rules.Azure'
2 changes: 2 additions & 0 deletions docs/CHANGELOG-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ What's changed since v1.24.1:
- Added `Azure.MCSB.v1` which include rules aligned to the Microsoft Cloud Security Beanchmark by @BernieWhite.
[#1634](https://github.com/Azure/PSRule.Rules.Azure/issues/1634)
- Engineering:
- Updated build to use GitHub Actions by @BernieWhite.
[#1696](https://github.com/Azure/PSRule.Rules.Azure/issues/1696)
- Bump BenchmarkDotNet to v0.13.4.
[#1992](https://github.com/Azure/PSRule.Rules.Azure/pull/1992)
- Bump BenchmarkDotNet.Diagnostics.Windows to v0.13.4.
Expand Down
File renamed without changes.

0 comments on commit 4b9cfc4

Please sign in to comment.