User Profile
pp
Copper Contributor
Joined 2 years ago
User Widgets
Recent Discussions
LaTex (.tex) pipeline
How can I compile and store the main.pdf file, back in the repository? Azure DevOps Pipeline (yaml). This is how far I got, without breaking it: Edited several times: trigger: - master pool: vmImage: 'ubuntu-latest' steps: - bash: | sudo apt-get install texlive # echo Starting pdflatex pdflatex -interaction=nonstopmode main.tex # echo Done pdflatex # Publish the file in question, the pdf - task: PublishPipelineArtifact@1 inputs: targetPath: main.pdf artifact: 'MyArtifact' publishLocation: 'pipeline' # This works well. The file is available in pipelines, related, published. Slightly faster than the DownloadBuildArtifact@ - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' artifactName: 'MyArtifact' targetPath: '$(Pipeline.Workspace)' It compiles, publishes the pdf and allows one to download it. Trying to discover how to store it back in the repository every time I sync with the main branch. Why: searching for a substitute to README.md https://www.reddit.com/r/azuredevops/comments/zstcxz/project_wikidocumentation/Solved4.1KViews1like2CommentsNative Unit Test (interop of c++ and c#) is not working?
How to reproduce: - Create a new cppUnitTestFramework (native unit test project c++) - Turn on /clr - Conformance mode: no (/permissive) - Debug information Format: none - Additional #using Directories: pointing to the bin, where the dll is located - Make sure you make all the above changes, before compiling for the first time Just trying to test interoperability between an EF core context (c#) and a Unit Test in C++ (in other words, a C++ unit test will access the EF context and get data from the DB)... Can't get it to work! There are several issues/warnings/errors I encountered so far: - C++ Language standard cannot be set above ISO C++ 17 (20 and the latest does not work. In March it is supposed to be released the new version... This means we won't get support again?) - (Warning) "The initializer for exported data will not be run until managed code is first executed in the host assembly". Does this mean I have to first add and use the C# context.dll before I can compile the C++ Unit Test Project? - The moment I activate the /clr and solve all issues[1], the Test Explorer no longer detects the Test Methods. So I can't debug or run them. What am I doing wrong? I just want to leverage C# code-first database perks, on a C++ Unit Test environment, and in the future in other C++ projects/apps/game-engine! Should I use something else? A template that is not from Microsoft? [1] -https://learn.microsoft.com/en-us/cpp/build/reference/clr-restrictions?view=msvc-170601Views0likes1CommentRe: LaTex (.tex) pipeline
This is the current solution that is working for me. - it compiles the LaTex and creates a main.pdf. - publishes and downloads to the pipeline. - pushes the main.pdf to the repository (without constantly triggering the master branch. Does not enter in an endless cycle of push and trigger pipeline). Azure-pipeline.yml: # specific branch build with batching trigger: batch: true # when a pipeline is running, the system waits until the run is completed branches: include: - master paths: include: - main.tex # attempt to trigger only when the main.tex is edited pool: vmImage: ubuntu-latest steps: - checkout: self persistCredentials: true - bash: | git checkout '$(Build.SourceBranchName)' # This is needed if you want to push later on sudo apt-get install texlive # echo 'Starting pdflatex' pdflatex -interaction=nonstopmode main.tex # echo 'Compile LaTex: Done' # Publish the file in question, the pdf - task: PublishPipelineArtifact@1 inputs: targetPath: main.pdf artifact: 'MyArtifact' publishLocation: 'pipeline' # This works well. The file is available in pipelines, related, published. Slightly faster than the DownloadBuild - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' artifactName: 'MyArtifact' targetPath: '$(Pipeline.Workspace)' # Push the main.pdf to the repository - bash: | # git checkout $(Build.SourceBranchName) git add main.pdf git config --global user.name '$(Build.RequestedFor)' git config --global user.email '$(Build.RequestedForEmail)' git commit -m "Update pdf" git push origin HEAD:master # this one works! #git push origin '$(Build.SourceBranchName)' # error is here!!? #git push origin HEAD:main # doesn't work for azure reps #git push origin HEAD:<$(Build.SourceBranchName)> # doesn't work usefull links.: azure rep documentation:https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#paths You need to give permissions to the "build service":https://stackoverflow.com/questions/66470759/set-git-credentials-inside-a-azure-yaml-pipeline Scripts need access to the token:https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/git-commands?view=azure-devops&tabs=yaml#allow-scripts-to-access-the-system-token An issue with "main" and "master" branches. This might be a bug, so I forced the name HEADER:master :https://stackoverflow.com/questions/4181861/message-src-refspec-master-does-not-match-any-when-pushing-commits-in-git Tip, use the assistant on the right corner to add baked code while editing the yaml in azure.3.8KViews0likes0Comments
Groups
Recent Blog Articles
No content to show