diff --git a/.github/workflows/commentsFromTests.md b/.github/workflows/commentsFromTests.md new file mode 100644 index 00000000..dd2ba900 --- /dev/null +++ b/.github/workflows/commentsFromTests.md @@ -0,0 +1,7 @@ +This PR has been [automatically tested with GH Actions](https://github.com/SysBioChalmers/Human-GEM/actions/runs/{GH_ACTION_RUN}). Here is the output of the gene essentiality test: + +
+{TEST_RESULTS}
+
+ +> _Note: In the case of multiple test runs, this post will be edited._ diff --git a/.github/workflows/gene-essentiality.yml b/.github/workflows/gene-essentiality.yml new file mode 100644 index 00000000..169efc71 --- /dev/null +++ b/.github/workflows/gene-essentiality.yml @@ -0,0 +1,33 @@ +name: Check gene essentiality with Hart 2015 + +on: + pull_request: + branches: + - "main" + - "develop" + +jobs: + check-metabolictasks: + runs-on: self-hosted + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Run gene essentiality + id: essentiality + run: | + TEST_RESULTS=$(/usr/local/bin/matlab -nodisplay -nosplash -nodesktop -r "addpath(genpath('.')); ihuman = importYaml('Human-GEM.yml'); taskStruct = parseTaskList('data/metabolicTasks/metabolicTasks_Essential.txt'); eGenes = estimateEssentialGenes(ihuman, 'Hart2015_RNAseq.txt', taskStruct); disp(evaluateHart2015Essentiality(eGenes));" | awk 'NR>9 && !/^\.+/') + PARSED_RESULTS="${TEST_RESULTS//'%'/'%25'}" + PARSED_RESULTS="${PARSED_RESULTS//$'\n'/'
'}" + PARSED_RESULTS="${PARSED_RESULTS//$'\r'/'
'}" + echo "results=$PARSED_RESULTS" >> $GITHUB_OUTPUT + + - name: Post comment + uses: NejcZdovc/comment-pr@v2 + with: + file: "commentsFromTests.md" + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + TEST_RESULTS: ${{steps.essentiality.outputs.results}} + GH_ACTION_RUN: ${{github.run_id}}