Skip to content

Commit

Permalink
FileConventions.Test: new test for ver. in env
Browse files Browse the repository at this point in the history
Added a failing test for finding inconsistent versions in
Github CI workflows when versions are stored in env vars
and are referenced with `env.` prefix (e.g. `env.FOO`).
  • Loading branch information
webwarrior-ws committed Nov 6, 2024
1 parent 92e1ef8 commit e318e0a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on: [push, pull_request]

env:
PULUMI_VERSION: 2.0.0

jobs:
jobA:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Setup Pulumi CLI
with:
pulumi-version: ${{ env.PULUMI_VERSION }}
- name: Print "Hello World!"
run: echo "Hello World!"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on: [push, pull_request]

env:
PULUMI_VERSION: 2.0.1

jobs:
jobA:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Setup Pulumi CLI
with:
pulumi-version: ${{ env.PULUMI_VERSION }}
- name: Print "Hello World!"
run: echo "Hello World!"
12 changes: 12 additions & 0 deletions src/FileConventions.Test/FileConventions.Test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@ let DetectInconsistentVersionsInGitHubCI2() =

Assert.That(DetectInconsistentVersionsInGitHubCI fileInfo, Is.EqualTo true)

[<Test>]
let DetectInconsistentVersionsInGitHubCI3() =
let fileInfo =
DirectoryInfo(
Path.Combine(
dummyFilesDirectory.FullName,
"DummyWorkflowsWithEnvPrefixed"
)
)

Assert.That(DetectInconsistentVersionsInGitHubCI fileInfo, Is.EqualTo true)

[<Test>]
let DetectInconsistentVersionsInNugetRefsInFSharpScripts1() =
let fileInfos =
Expand Down

0 comments on commit e318e0a

Please sign in to comment.