Skip to content

Commit

Permalink
update ci script and add changes from master to test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
abaskk-msft committed Jul 2, 2024
1 parent d36b692 commit de22930
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
os: [windows-latest, macos-latest, ubuntu-latest]
env:
DOTNET_NOLOGO: true
PERSISTENCE_TEST_YAML_APP_VALID: "../../src/Persistence.Tests/_TestData/AppsWithYaml/Src"
PERSISTENCE_TEST_YAML_FILES_VALID: "../../src/Persistence.Tests/_TestData/ValidYaml-CI"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -53,16 +51,16 @@ jobs:

- name: Test - Persistence Test Yaml Files (ubuntu & macos)
run: |
resultApp=$(dotnet bin/Debug/YamlValidator/YamlValidator.dll validate --path ${{ env.PERSISTENCE_TEST_YAML_APP_VALID }})
resultApp=$(dotnet bin/Debug/YamlValidator/YamlValidator.dll validate --path "../Persistence.Tests/_TestData/AppsWithYaml")
echo "$resultApp"
if [ "$resultApp" == *"Validation Failed"* ]; then
echo "Invalid Yaml Files found in ${{ env.PERSISTENCE_TEST_YAML_APP_VALID }}"
echo "Invalid Yaml Files found in ../../src/Persistence.Tests/_TestData/AppsWithYaml"
exit 1
fi
resultFiles=$(dotnet bin/Debug/YamlValidator/YamlValidator.dll validate --path ${{ env.PERSISTENCE_TEST_YAML_FILES_VALID }})
resultFiles=$(dotnet bin/Debug/YamlValidator/YamlValidator.dll validate --path "../Persistence.Tests/_TestData/ValidYaml-CI")
echo "$resultFiles"
if [ "$resultFiles" == *"Validation Failed"* ]; then
echo "Invalid Yaml Files found in ${{ env.PERSISTENCE_TEST_YAML_FILES_VALID }}"
echo "Invalid Yaml Files found in ../../src/Persistence.Tests/_TestData/ValidYaml-CI"
exit 1
fi
if: ${{ runner.os != 'Windows' }}
Expand Down
2 changes: 1 addition & 1 deletion src/YamlValidator/YamlLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public IReadOnlyDictionary<string, string> Load(string filePath, string pathType
var yamlFiles = Directory.EnumerateFiles(filePath, "*" + Constants.YamlFileExtension, SearchOption.AllDirectories);
foreach (var filename in yamlFiles)
{
var fileName = Path.GetFileName(filename);
var fileName = Path.GetRelativePath(filePath, filename);
var yamlText = Utility.ReadFileData(filename);
deserializedYaml.Add(fileName, yamlText);
}
Expand Down

0 comments on commit de22930

Please sign in to comment.