Test Package #1556
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Package | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 2 * * 1' | |
jobs: | |
flake8_tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install flake8 | |
run: pip install flake8 | |
- name: Run flake8 | |
run: flake8 . | |
python3_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [debian12, debian11, debian10, ubuntu24.10, ubuntu24.04, ubuntu22.04] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
- name: Build the docker | |
env: | |
OS: ${{ matrix.os }} | |
run: docker build -t ndts .ci/${OS}_py3 | |
- name: Run the docker | |
run: docker run --name ndts -d -it -v `pwd`:/home/tango ndts | |
- name: install tango and lavue | |
env: | |
OS: ${{ matrix.os }} | |
run: .ci/install.sh ${OS} 3 | |
- name: run basic tests | |
run: .ci/run.sh 3 basic | |
- name: run basic2 tests | |
run: .ci/run.sh 3 basic2 | |
- name: run basic3 tests | |
run: .ci/run.sh 3 basic3 | |
- name: run general tool tests | |
run: .ci/run.sh 3 generaltools | |
- name: run specialized tool tests | |
run: .ci/run.sh 3 specializedtools | |
- name: run diffractogram tests | |
run: .ci/run.sh 3 diffractogram | |
- name: run tangosource tests | |
run: .ci/run.sh 3 tangosource | |
- name: run tangofilesource tests | |
run: .ci/run.sh 3 tangofilesource | |
- name: run httpsource tests | |
run: .ci/run.sh 3 httpsource | |
- name: Append documentation for the latest release version | |
if: github.ref == 'refs/heads/develop' && matrix.os == 'debian12' | |
run: | | |
docker exec ndts /bin/bash -c "cp doc/index.html doc/_config.yml build" | |
docker exec ndts /bin/bash -c "mkdir -p ./build/doc_html && cp -r doc_html/* ./build/doc_html/" | |
docker exec ndts /bin/bash -c "git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'" | |
docker exec ndts /bin/bash -c "git fetch && git checkout gh-pages && git pull" | |
docker exec ndts /bin/bash -c "mkdir -p ./latest && shopt -u dotglob && rm -rf ./latest/*" | |
docker exec ndts /bin/bash -c "mkdir -p ./latest/doc_html" | |
docker exec ndts /bin/bash -c "mv -f build/sphinx/html/* ./latest/" | |
docker exec ndts /bin/bash -c "mv -f build/index.html build/_config.yml ." | |
docker exec ndts /bin/bash -c "mv -f build/doc_html/* ./latest/doc_html/" | |
docker exec --user root ndts /bin/bash -c "rm -rf build test lavuelib dist lavue.egg-info testresult.txt" | |
- name: Extract the code version from the branch name | |
if: startsWith(github.ref, 'refs/heads/docs_') && matrix.os == 'debian12' | |
shell: bash | |
run: echo "##[set-output name=docver;]$(echo ${GITHUB_REF#refs/heads/docs_})" | |
id: extract_docver | |
- name: Append documentation for the extracted release version | |
if: startsWith(github.ref, 'refs/heads/docs_') && matrix.os == 'debian12' | |
run: | | |
echo Version: ${{ steps.extract_docver.outputs.docver }} | |
docker exec ndts /bin/bash -c "mkdir -p ./build/doc_html && cp -r doc_html/* ./build/doc_html/" | |
docker exec ndts /bin/bash -c "git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'" | |
docker exec ndts /bin/bash -c "git fetch && git checkout gh-pages && git pull" | |
docker exec ndts /bin/bash -c "mkdir -p ./${{ steps.extract_docver.outputs.docver }}/doc_html/" | |
docker exec ndts /bin/bash -c "shopt -u dotglob && rm -rf ./${{ steps.extract_docver.outputs.docver }}/* " | |
docker exec ndts /bin/bash -c "mv -f build/sphinx/html/* ./${{ steps.extract_docver.outputs.docver }}" | |
docker exec ndts /bin/bash -c "mkdir -p ./${{ steps.extract_docver.outputs.docver }}/doc_html" | |
docker exec ndts /bin/bash -c "mv -f build/doc_html/* ./${{ steps.extract_docver.outputs.docver }}/doc_html/" | |
docker exec --user root ndts /bin/bash -c "rm -rf build test lavuelib dist lavue.egg-info testresult.txt" | |
- name: Deploy documentation | |
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/docs_')) && matrix.os == 'debian12' | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: gh-pages | |
FOLDER: . | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MESSAGE: "Build: ({sha}) {msg}" | |
- name: Stop the docker | |
run: docker container stop ndts | |
python2_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [debian10] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
- name: Build the docker | |
env: | |
OS: ${{ matrix.os }} | |
run: docker build -t ndts .ci/${OS}_py2 | |
- name: Run the docker | |
run: docker run --name ndts -d -it -v `pwd`:/home/tango ndts | |
- name: install tango and lavue | |
env: | |
OS: ${{ matrix.os }} | |
run: .ci/install.sh ${OS} 2 | |
- name: run basic tests | |
run: .ci/run.sh 2 basic | |
- name: run general tool tests | |
run: .ci/run.sh 2 generaltools | |
- name: run specialized tool tests | |
run: .ci/run.sh 2 specializedtools | |
- name: run diffractogram tests | |
run: .ci/run.sh 2 diffractogram | |
- name: run tangosource tests | |
run: .ci/run.sh 2 tangosource | |
- name: run tangofilesource tests | |
run: .ci/run.sh 2 tangofilesource | |
- name: run httpsource tests | |
run: .ci/run.sh 2 httpsource | |
- name: Stop the docker | |
run: docker container stop ndts |