From 35f24e881fa5fe5699e204ea547b7d656c226e52 Mon Sep 17 00:00:00 2001 From: ReimarBauer Date: Thu, 25 May 2023 20:43:41 +0200 Subject: [PATCH 1/6] enable tests for GSOC branches --- .github/workflows/testing-develop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/testing-develop.yml b/.github/workflows/testing-develop.yml index 208899dfe..4c67b4213 100644 --- a/.github/workflows/testing-develop.yml +++ b/.github/workflows/testing-develop.yml @@ -4,10 +4,13 @@ on: push: branches: - develop + - 'GSOC**' pull_request: branches: - develop + - 'GSOC**' + jobs: test-develop: From b575f5b27656f17a5ed5c7117fe1c4fcfaa1efa0 Mon Sep 17 00:00:00 2001 From: ReimarBauer Date: Fri, 26 May 2023 14:26:15 +0200 Subject: [PATCH 2/6] added a new testing action based on develop for gsoc --- .github/workflows/testing-develop.yml | 2 - .github/workflows/testing_gsoc.yml | 106 ++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/testing_gsoc.yml diff --git a/.github/workflows/testing-develop.yml b/.github/workflows/testing-develop.yml index 4c67b4213..b58ac4a89 100644 --- a/.github/workflows/testing-develop.yml +++ b/.github/workflows/testing-develop.yml @@ -4,12 +4,10 @@ on: push: branches: - develop - - 'GSOC**' pull_request: branches: - develop - - 'GSOC**' jobs: diff --git a/.github/workflows/testing_gsoc.yml b/.github/workflows/testing_gsoc.yml new file mode 100644 index 000000000..478763ea8 --- /dev/null +++ b/.github/workflows/testing_gsoc.yml @@ -0,0 +1,106 @@ +name: test GSOC branches + +on: + push: + branches: + - 'GSOC**' + + pull_request: + branches: + - 'GSOC**' + +env: + PAT: ${{ secrets.PAT }} + + +jobs: + Test-MSS-GSOC: + runs-on: ubuntu-latest + secrets: + PAT: ${{ secrets.PAT }} + + defaults: + run: + shell: bash + + container: + image: openmss/testing-develop + + steps: + - name: Trust My Directory + run: git config --global --add safe.directory /__w/MSS/MSS + + - uses: actions/checkout@v3 + + - name: Check for changed dependencies + run: | + cmp -s /meta.yaml localbuild/meta.yaml && cmp -s /development.txt requirements.d/development.txt \ + || (echo Dependencies differ \ + && echo "triggerdockerbuild=yes" >> $GITHUB_ENV ) + + - name: Reinstall dependencies if changed + if: ${{ success() && env.triggerdockerbuild == 'yes' }} + run: | + cd $GITHUB_WORKSPACE \ + && source /opt/conda/etc/profile.d/conda.sh \ + && source /opt/conda/etc/profile.d/mamba.sh \ + && mamba activate mss-develop-env \ + && mamba deactivate \ + && cat localbuild/meta.yaml \ + | sed -n '/^requirements:/,/^test:/p' \ + | sed -e "s/.*- //" \ + | sed -e "s/menuinst.*//" \ + | sed -e "s/.*://" > reqs.txt \ + && cat requirements.d/development.txt >> reqs.txt \ + && echo pyvirtualdisplay >> reqs.txt \ + && cat reqs.txt \ + && mamba env remove -n mss-develop-env \ + && mamba create -y -n mss-develop-env --file reqs.txt + + - name: Print conda list + run: | + source /opt/conda/etc/profile.d/conda.sh \ + && source /opt/conda/etc/profile.d/mamba.sh \ + && mamba activate mss-develop-env \ + && mamba list + + - name: Run tests + if: ${{ success() && inputs.xdist == 'no' }} + timeout-minutes: 25 + run: | + cd $GITHUB_WORKSPACE \ + && source /opt/conda/etc/profile.d/conda.sh \ + && source /opt/conda/etc/profile.d/mamba.sh \ + && mamba activate mss-${{ inputs.branch_name }}-env \ + && pytest -v --durations=20 --reverse --cov=mslib tests \ + || (for i in {1..5} \ + ; do pytest tests -v --durations=0 --reverse --last-failed --lfnf=none \ + && break \ + ; done) + + + - name: Run tests in parallel + if: ${{ success() && inputs.xdist == 'yes' }} + timeout-minutes: 25 + run: | + cd $GITHUB_WORKSPACE \ + && source /opt/conda/etc/profile.d/conda.sh \ + && source /opt/conda/etc/profile.d/mamba.sh \ + && mamba activate mss-develop-env \ + && pytest -vv -n 6 --dist loadfile --max-worker-restart 0 tests \ + || (for i in {1..5} \ + ; do pytest -vv -n 6 --dist loadfile --max-worker-restart 0 tests --last-failed --lfnf=none \ + && break \ + ; done) + + - name: Collect coverage + if: ${{ success() && inputs.event_name == 'push' && inputs.branch_name == 'develop' && inputs.xdist == 'no'}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd $GITHUB_WORKSPACE \ + && source /opt/conda/etc/profile.d/conda.sh \ + && source /opt/conda/etc/profile.d/mamba.sh \ + && mamba activate mss-${{ inputs.branch_name }}-env \ + && mamba install coveralls \ + && coveralls --service=github From 96fa8d0e9a3605e3f8b2b09b072e14c1be1bd165 Mon Sep 17 00:00:00 2001 From: ReimarBauer Date: Fri, 26 May 2023 14:28:54 +0200 Subject: [PATCH 3/6] undo blank --- .github/workflows/testing-develop.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/testing-develop.yml b/.github/workflows/testing-develop.yml index b58ac4a89..8884a76d9 100644 --- a/.github/workflows/testing-develop.yml +++ b/.github/workflows/testing-develop.yml @@ -9,8 +9,7 @@ on: branches: - develop - -jobs: +jobs: test-develop: uses: ./.github/workflows/testing.yml From 250e2aa078c8023d4879c7999c07735103e6ccc6 Mon Sep 17 00:00:00 2001 From: ReimarBauer Date: Sun, 28 May 2023 12:40:04 +0200 Subject: [PATCH 4/6] var changed --- .github/workflows/testing_gsoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing_gsoc.yml b/.github/workflows/testing_gsoc.yml index 478763ea8..1cd8a11e7 100644 --- a/.github/workflows/testing_gsoc.yml +++ b/.github/workflows/testing_gsoc.yml @@ -101,6 +101,6 @@ jobs: cd $GITHUB_WORKSPACE \ && source /opt/conda/etc/profile.d/conda.sh \ && source /opt/conda/etc/profile.d/mamba.sh \ - && mamba activate mss-${{ inputs.branch_name }}-env \ + && mamba activate mss-develop-env \ && mamba install coveralls \ && coveralls --service=github From 7e39fed1c09bd819dec3b90db406ff24ca6b5ecd Mon Sep 17 00:00:00 2001 From: ReimarBauer Date: Sun, 28 May 2023 12:42:40 +0200 Subject: [PATCH 5/6] name changed --- .github/workflows/testing_gsoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing_gsoc.yml b/.github/workflows/testing_gsoc.yml index 1cd8a11e7..e6cf72b57 100644 --- a/.github/workflows/testing_gsoc.yml +++ b/.github/workflows/testing_gsoc.yml @@ -71,7 +71,7 @@ jobs: cd $GITHUB_WORKSPACE \ && source /opt/conda/etc/profile.d/conda.sh \ && source /opt/conda/etc/profile.d/mamba.sh \ - && mamba activate mss-${{ inputs.branch_name }}-env \ + && mamba activate mss-develop-env \ && pytest -v --durations=20 --reverse --cov=mslib tests \ || (for i in {1..5} \ ; do pytest tests -v --durations=0 --reverse --last-failed --lfnf=none \ From e1bb1214b5f3bc8affdffb4a9e0664f1b0fc524e Mon Sep 17 00:00:00 2001 From: ReimarBauer Date: Sun, 28 May 2023 13:04:03 +0200 Subject: [PATCH 6/6] removed unexpected value --- .github/workflows/testing_gsoc.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/testing_gsoc.yml b/.github/workflows/testing_gsoc.yml index e6cf72b57..cf28fd29a 100644 --- a/.github/workflows/testing_gsoc.yml +++ b/.github/workflows/testing_gsoc.yml @@ -16,8 +16,6 @@ env: jobs: Test-MSS-GSOC: runs-on: ubuntu-latest - secrets: - PAT: ${{ secrets.PAT }} defaults: run: