Skip to content

Commit a4e4039

Browse files
committed
Merge branch 'nightly-build' of https://github.com/Gijsreyn/operation-methods into nightly-build
2 parents 305bbb4 + 24fda82 commit a4e4039

File tree

35 files changed

+2380
-253
lines changed

35 files changed

+2380
-253
lines changed

.github/instructions/instructions.md

Lines changed: 459 additions & 0 deletions
Large diffs are not rendered by default.

.pipelines/DSC-Official.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,17 @@ extends:
236236
ob_restore_phase: true
237237
- pwsh: |
238238
apt update
239-
apt -y install musl-tools
239+
apt -y install musl-tools rpm dpkg build-essential
240240
$header = "Bearer $(AzToken)"
241241
$env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header
242242
$env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token'
243243
./build.ps1 -Release -Architecture x86_64-unknown-linux-musl
244244
./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-musl -Release
245+
./build.ps1 -PackageType rpm -Architecture x86_64-unknown-linux-musl -Release
246+
./build.ps1 -PackageType deb -Architecture x86_64-unknown-linux-musl -Release
245247
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
248+
Copy-Item ./bin/*.rpm "$(ob_outputDirectory)"
249+
Copy-Item ./bin/*.deb "$(ob_outputDirectory)"
246250
displayName: 'Build x86_64-unknown-linux-musl'
247251
condition: succeeded()
248252
@@ -289,6 +293,9 @@ extends:
289293
#apt -y install gcc-multilib
290294
apt -y install libssl-dev
291295
apt -y install pkg-config
296+
apt -y install rpm
297+
apt -y install dpkg
298+
apt -y install build-essential
292299
msrustup default stable-aarch64-unknown-linux-musl
293300
if ((openssl version -d) -match 'OPENSSLDIR: "(?<dir>.*?)"') {
294301
$env:OPENSSL_LIB_DIR = $matches['dir']
@@ -298,7 +305,11 @@ extends:
298305
$env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token'
299306
./build.ps1 -Release -Architecture aarch64-unknown-linux-musl
300307
./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-musl -Release
308+
./build.ps1 -PackageType rpm -Architecture aarch64-unknown-linux-musl -Release
309+
./build.ps1 -PackageType deb -Architecture aarch64-unknown-linux-musl -Release
301310
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
311+
Copy-Item ./bin/*.rpm "$(ob_outputDirectory)"
312+
Copy-Item ./bin/*.deb "$(ob_outputDirectory)"
302313
displayName: 'Build aarch64-unknown-linux-musl'
303314
condition: succeeded()
304315
@@ -370,11 +381,17 @@ extends:
370381

371382
- download: current
372383
artifact: drop_BuildAndSign_BuildLinuxArm64Musl
373-
patterns: '*.tar.gz'
384+
patterns: |
385+
*.tar.gz
386+
*.rpm
387+
*.deb
374388
375389
- download: current
376390
artifact: drop_BuildAndSign_BuildLinuxMusl
377-
patterns: '*.tar.gz'
391+
patterns: |
392+
*.tar.gz
393+
*.rpm
394+
*.deb
378395
379396
- download: current
380397
artifact: release ## this includes artifacts for macOS
@@ -385,7 +402,7 @@ extends:
385402
patterns: '*.msixbundle'
386403

387404
- pwsh: |
388-
Get-ChildItem "$(Pipeline.Workspace)" -Recurse -Include '*.zip', '*.tar.gz', '*.msixbundle' | ForEach-Object {
405+
Get-ChildItem "$(Pipeline.Workspace)" -Recurse -Include '*.zip', '*.tar.gz', '*.msixbundle', '*.rpm', '*.deb' | ForEach-Object {
389406
Write-Host "Found artifact: $($_.FullName)"
390407
}
391408
displayName: List downloaded artifacts
@@ -398,7 +415,7 @@ extends:
398415
399416
Write-Verbose -Verbose "Starting to copy"
400417
401-
Get-ChildItem "$(Pipeline.Workspace)" -Recurse -Include '*.zip', '*.tar.gz', '*.msixbundle' | ForEach-Object {
418+
Get-ChildItem "$(Pipeline.Workspace)" -Recurse -Include '*.zip', '*.tar.gz', '*.msixbundle', '*.rpm', '*.deb' | ForEach-Object {
402419
Copy-Item -Path $_.FullName -Destination $outputDir -Force -Verbose
403420
}
404421
@@ -448,7 +465,7 @@ extends:
448465
script: |
449466
Write-Verbose -Verbose "Release version: $(PackageVersion)"
450467
451-
$artifacts = Get-ChildItem "$(Pipeline.Workspace)" -Recurse -Include '*.zip', '*.tar.gz', '*.msixbundle'
468+
$artifacts = Get-ChildItem "$(Pipeline.Workspace)" -Recurse -Include '*.zip', '*.tar.gz', '*.msixbundle', '*.rpm', '*.deb'
452469
453470
$artifacts | ForEach-Object {
454471
Write-Verbose -Verbose "Found artifact: $($_.FullName)"
@@ -489,6 +506,8 @@ extends:
489506
$(GitHubReleaseDirectory)\*.zip
490507
$(GitHubReleaseDirectory)\*.tar.gz
491508
$(GitHubReleaseDirectory)\*.msixbundle
509+
$(GitHubReleaseDirectory)\*.rpm
510+
$(GitHubReleaseDirectory)\*.deb
492511
addChangeLog: false
493512
tagSource: 'userSpecifiedTag'
494513
tag: '$(GitHubReleaseVersion)'

CONTRIBUTING.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,153 @@ To run the link-checker, follow these steps:
6767
`npm install -g [email protected]`
6868
* run `find . \*.md -exec markdown-link-check {} \;`
6969

70+
## Contributing to Code
71+
72+
### Contributor License Agreement (CLA)
73+
74+
Contributions to the DSC repository requires signing the [Contributor License Agreement (CLA)][01].
75+
You can manually sign the CLA at any time. When you submit a pull request to this repository, the
76+
continuous integration will check whether you have already signed the CLA. If you haven't, the
77+
automation will prompt you to do so as a comment on your PR.
78+
79+
We can't accept any contributions without the author signing the CLA. Signing the CLA is a one-time
80+
requirement and applies to contributions to Microsoft open source repositories.
81+
82+
For more information, see [Contributor License Agreements][01].
83+
84+
[01]: https://cla.microsoft.com/
85+
86+
### Building and testing
87+
88+
#### Prerequisites
89+
90+
Building the DSC project requires PowerShell 7.2 or later to execute the build script. For more
91+
information about installing PowerShell, see [Install PowerShell on Windows, Linux, and macOS][02].
92+
93+
DSC requires other tools for building the project. The build script (`build.new.ps1`) installs the
94+
tools in the following table if they aren't already installed on your system:
95+
96+
| Tool | Version | Platforms | Projects |
97+
|:--------------------------------------------------------|:-------------:|:---------------------:|:-----------------------------------------------------|
98+
| [Rust toolchain][03] | Latest stable | Linux, macOS, Windows | All Rust crates |
99+
| [Visual Studio Build Tools for C++][04] | Latest stable | Windows | All Rust crates |
100+
| [`cargo audit`][05] | Latest stable | Linux, macOS, Windows | All Rust crates |
101+
| [Clippy][06] | Latest stable | Linux, macOS, Windows | All Rust crates |
102+
| [Tree-sitter CLI][07] | Latest stable | Linux, macOS, Windows | All grammars |
103+
| [NodeJS][08] | `v24` | Linux, macOS, Windows | All grammars |
104+
| [**Pester** PowerShell module][09] | Latest stable | Linux, macOS, Windows | All acceptance tests |
105+
| [**PSDesiredStateConfiguration** PowerShell module][10] | `v2.0.7` | Windows | `Microsoft.Windows/WindowsPowerShell` adapter tests |
106+
107+
[02]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell
108+
[03]: https://rustup.rs/
109+
[04]: https://learn.microsoft.com/cpp/windows/latest-supported-vc-redist
110+
[05]: https://crates.io/crates/cargo-audit
111+
[06]: https://doc.rust-lang.org/clippy/index.html
112+
[07]: https://github.com/tree-sitter/tree-sitter/blob/master/crates/cli/README.md
113+
[08]: https://nodejs.org/
114+
[09]: https://pester.dev/
115+
[10]: https://www.powershellgallery.com/packages/PSDesiredStateConfiguration/2.0.7
116+
117+
#### Quick start
118+
119+
```powershell
120+
# Build the project
121+
./build.new.ps1
122+
123+
# Build with linting (recommended)
124+
./build.new.ps1 -Clippy
125+
126+
# Build and run all tests
127+
./build.new.ps1 -Clippy -Test
128+
129+
# Build in release mode (optimized)
130+
./build.new.ps1 -Release
131+
```
132+
133+
#### Running tests
134+
135+
DSCv3 includes Rust unit tests and PowerShell Pester tests:
136+
137+
```powershell
138+
# Run all tests
139+
./build.new.ps1 -Test
140+
141+
# Run only Rust tests
142+
./build.new.ps1 -Test -ExcludePesterTests
143+
144+
# Run only Pester tests
145+
./build.new.ps1 -Test -ExcludeRustTests
146+
147+
# Run specific Pester test groups
148+
./build.new.ps1 -SkipBuild -Test -ExcludeRustTests -PesterTestGroup dsc
149+
```
150+
151+
Available Pester test groups include:
152+
153+
- `dsc` - Acceptance tests for the `dsc` executable.
154+
- `adapters` - Acceptance tests for projects in the `adapters` folder.
155+
- `extensions` - Acceptance tests for projects in the `extensions` folder.
156+
- `resources` - Acceptance tests for projects in the `resources` folder.
157+
- `grammars` - Acceptance tests for projects in the `grammars` folder.
158+
159+
#### Cross-platform builds
160+
161+
By default, the build script compiles code for the current platform and architecture. You can build
162+
for other platforms and architectures with the `-Architecture` parameter:
163+
164+
```powershell
165+
# Windows ARM
166+
./build.new.ps1 -Architecture aarch64-pc-windows-msvc
167+
168+
# macOS Apple Silicon
169+
./build.new.ps1 -Architecture aarch64-apple-darwin
170+
171+
# Linux x64
172+
./build.new.ps1 -Architecture x86_64-unknown-linux-gnu
173+
```
174+
175+
#### Additional Information
176+
177+
For detailed build instructions, troubleshooting, and CI/CD workflows, see the
178+
[Build and Test Instructions](.github/instructions/instructions.md).
179+
180+
### Pull Request Guidelines
181+
182+
- Always create a pull request to the `main` branch of this repository.
183+
- Avoid making big pull requests. Before you invest a large amount of time, file an issue and start
184+
a discussion with the community.
185+
- Add a meaningful title to the PR describing what change you want to check in.
186+
- When you create a pull request, include a summary about your changes in the PR description. If
187+
the changes are related to an existing GitHub issue, please reference the issue in the PR
188+
description (e.g. `Fix #123`).
189+
- Please use the present tense and imperative mood when describing your changes:
190+
191+
- Instead of `Adding support for new feature`, write `Add support for new feature`.
192+
- Instead of `Fixed bug in parser`, write `Fix bug in parser`.
193+
194+
- If your change adds a new source file, ensure the appropriate copyright and license headers are
195+
included at the top of the file:
196+
197+
- For `.rs` files, use the copyright header with an empty line after it:
198+
199+
```rust
200+
// Copyright (c) Microsoft Corporation.
201+
// Licensed under the MIT License.
202+
203+
```
204+
205+
- For `.ps1` and `.psm1` files, use the copyright header with an empty line after it:
206+
207+
```powershell
208+
# Copyright (c) Microsoft Corporation.
209+
# Licensed under the MIT License.
210+
211+
```
212+
213+
* Create and update relevant tests when making code changes.
214+
* Run tests and ensure they're passing before opening a pull request.
215+
* All pull requests **must** pass CI checks before they can be merged.
216+
70217
## Code of Conduct Enforcement
71218

72219
Reports of abuse will be reviewed by the PS-Committee and if it has been determined that violations of the

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ To install DSC v3:
4242
1. Expand the release archive.
4343
1. Add the folder containing the expanded archive contents to the `PATH`.
4444

45+
For information on building and testing DSC from source, see the [Contributing Guide](CONTRIBUTING.md).
46+
4547
## Explore DSCv3
4648

4749
If you're new to DSC or configuration management, we recommend reviewing the [documentation][02].

0 commit comments

Comments
 (0)