diff --git a/.github/scripts/_meta.mts b/.github/scripts/_meta.mts index 1847621d..576a2eac 100644 --- a/.github/scripts/_meta.mts +++ b/.github/scripts/_meta.mts @@ -8,6 +8,7 @@ export type Vertical = { readonly type: VerticalType; readonly name: string; readonly path: string; + readonly relPath: string; readonly rawConfig: Readonly>; }; @@ -33,7 +34,13 @@ const readVertical = (type: VerticalType, dirPath: string): Vertical => { name = config.name; } - return { type, name, path: verticalPath, rawConfig: config }; + return { + type, + name, + path: verticalPath, + relPath: dirPath, + rawConfig: config, + }; }; const apps = await globby(`${vertialDirs.app}/*`, { onlyDirectories: true }); diff --git a/.github/scripts/list-verticals.mts b/.github/scripts/list-verticals.mts index 2a463f2a..ac559982 100644 --- a/.github/scripts/list-verticals.mts +++ b/.github/scripts/list-verticals.mts @@ -8,4 +8,4 @@ if (type) { output = verticals.filter((v) => v.type === type); } -actions.setOutput("verticals", JSON.stringify(output.map((v) => v.name))); +actions.setOutput("verticals", JSON.stringify(output.map((v) => v.relPath))); diff --git a/.github/workflows/ci-check-slns.yml b/.github/workflows/ci-check-slns.yml new file mode 100644 index 00000000..628620e0 --- /dev/null +++ b/.github/workflows/ci-check-slns.yml @@ -0,0 +1,35 @@ +name: "CI: Check solution files" + +on: + push: {} + +jobs: + check-slns: + name: Check sln files + if: ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || github.event_name == 'push') && github.repository_owner == 'Altinn' && github.actor != 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - uses: pnpm/action-setup@v3 + with: + version: 9 + run_install: | + - cwd: .github/scripts + args: [--frozen-lockfile] + - args: [--global, tsx] + + - name: Update all sln files + run: tsx ./.github/scripts/update-sln-files.mts + + - name: Assert that no sln files have changed + run: git diff --exit-code diff --git a/.github/workflows/libs-ci.yml b/.github/workflows/libs-ci.yml index 74181749..d0ecf241 100644 --- a/.github/workflows/libs-ci.yml +++ b/.github/workflows/libs-ci.yml @@ -16,7 +16,7 @@ jobs: find-verticals: uses: ./.github/workflows/_find-verticals.yml with: - type: app + type: lib ci: name: CI