diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml index 73549743a..1581d083a 100644 --- a/.github/workflows/ci-e2e.yml +++ b/.github/workflows/ci-e2e.yml @@ -37,10 +37,10 @@ jobs: with: dotnet-version: 6.0.x - - name: Check if there is a corresponding branch in Machine + - name: Check if there is a corresponding branch in Serval id: find_matching_branch continue-on-error: true - if: ${{ github.ref_name }} != "main" + if: ${{ github.ref_name }} != "master" run: cd .. && git clone https://github.com/sillsdev/serval.git --branch ${{ github.ref_name }} && dotnet build machine && dotnet build serval && docker compose -f "serval/docker-compose.yml" up -d && sleep 20 - name: Get Serval and start containers @@ -65,10 +65,10 @@ jobs: if: ${{ failure() }} run: docker ps -a && docker logs --since 10m serval_cntr && docker logs --since 10m echo_cntr && docker logs --since 10m machine-engine-cntr && docker logs --since 10m serval-mongo-1 && docker logs --since 10m machine-job-cntr - - name: Stop containers branch - if: (${{ success() || failure() }} && steps.find_matching_branch.outcome != 'success') + - name: Stop containers main + if: ${{ (success() || failure()) && (steps.find_matching_branch.outcome != 'success')}} run: docker compose -f "../tmp/serval/docker-compose.yml" down - - name: Stop containers main - if: (${{ success() || failure() }} && steps.find_matching_branch.outcome == 'success') + - name: Stop containers branch + if: ${{ (success() || failure()) && (steps.find_matching_branch.outcome == 'success')}} run: docker compose -f "../serval/docker-compose.yml" down diff --git a/src/SIL.Machine.AspNetCore/Services/NmtPreprocessBuildJob.cs b/src/SIL.Machine.AspNetCore/Services/NmtPreprocessBuildJob.cs index 2bf446456..fd9f6217c 100644 --- a/src/SIL.Machine.AspNetCore/Services/NmtPreprocessBuildJob.cs +++ b/src/SIL.Machine.AspNetCore/Services/NmtPreprocessBuildJob.cs @@ -121,8 +121,10 @@ CancellationToken cancellationToken foreach (Corpus corpus in corpora) { ITextCorpus[] sourceTextCorpora = _corpusService.CreateTextCorpora(corpus.SourceFiles).ToArray(); - ITextCorpus? targetTextCorpus = _corpusService.CreateTextCorpora(corpus.TargetFiles).FirstOrDefault(); - if (sourceTextCorpora.Length == 0 || targetTextCorpus is null) + ITextCorpus targetTextCorpus = + _corpusService.CreateTextCorpora(corpus.TargetFiles).FirstOrDefault() ?? new DictionaryTextCorpus(); + + if (sourceTextCorpora.Length == 0) continue; int skipCount = 0;