From 28d3f1631f0eb8bc3e6866f1739ba67e78fe4c11 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Sun, 28 Apr 2024 20:37:06 +0100 Subject: [PATCH] run less builds --- .github/workflows/build.yml | 4 +++- projenrc/rosetta.ts | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a747e67..c2c0dd38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -106,6 +106,9 @@ jobs: run: test $(npx jsii-rosetta --version) = "${{ matrix.rosetta }}" strategy: matrix: + include: + - rosetta: 5.4.0 + os: windows-latest rosetta: - 1.85.0 - 5.0.14 @@ -115,4 +118,3 @@ jobs: - 5.4.0 os: - ubuntu-latest - - windows-latest diff --git a/projenrc/rosetta.ts b/projenrc/rosetta.ts index 9d3e88cb..12fbfbcf 100644 --- a/projenrc/rosetta.ts +++ b/projenrc/rosetta.ts @@ -25,6 +25,9 @@ export class RosettaPeerDependency extends Component { super(project); const constraint = this.calculateVersionConstraint(options.supportedVersions); + const minVersions = this.calculateMinimalVersions(options.supportedVersions); + const latestVersion = this.calculateLatestVersion(options.supportedVersions); + project.addDevDeps(constraint); project.addPeerDeps(constraint); @@ -38,9 +41,13 @@ export class RosettaPeerDependency extends Component { strategy: { matrix: { domain: { - rosetta: this.calculateMinimalVersions(options.supportedVersions), - os: ['ubuntu-latest', 'windows-latest'], + rosetta: minVersions, + os: ['ubuntu-latest'], }, + include: [{ + rosetta: latestVersion, + os: 'windows-latest', + }], }, }, steps: [{ @@ -96,4 +103,9 @@ export class RosettaPeerDependency extends Component { return discoveredVersions; } + + private calculateLatestVersion(versions: RosettaPeerDependencyOptions['supportedVersions']): string { + const discoveredVersions = this.calculateMinimalVersions(versions); + return discoveredVersions.sort().pop() ?? 'latest'; + } }