Skip to content

Commit

Permalink
ci: more
Browse files Browse the repository at this point in the history
  • Loading branch information
Alxandr committed Oct 8, 2024
1 parent 1737e0d commit e2f02b8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/scripts/_meta.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type Vertical = {
readonly type: VerticalType;
readonly name: string;
readonly path: string;
readonly relPath: string;
readonly rawConfig: Readonly<Record<string, unknown>>;
};

Expand All @@ -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 });
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/list-verticals.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
35 changes: 35 additions & 0 deletions .github/workflows/ci-check-slns.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/libs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
find-verticals:
uses: ./.github/workflows/_find-verticals.yml
with:
type: app
type: lib

ci:
name: CI
Expand Down

0 comments on commit e2f02b8

Please sign in to comment.