From 121f610c30ddaeff62df9a705a2ed54e54d98510 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Wed, 14 Feb 2024 13:51:26 -0600 Subject: [PATCH 1/6] CI #136 rename file --- .github/workflows/{unit-tests-pytest.yml => code.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{unit-tests-pytest.yml => code.yml} (100%) diff --git a/.github/workflows/unit-tests-pytest.yml b/.github/workflows/code.yml similarity index 100% rename from .github/workflows/unit-tests-pytest.yml rename to .github/workflows/code.yml From cdce7d8ca4d6406a7f60c845dc894288f609dcba Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Wed, 14 Feb 2024 15:43:06 -0600 Subject: [PATCH 2/6] CI add dependabot altering service --- .github/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..5af5c610 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# Set update schedule for GitHub Actions +# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" From 60c85b7e0bdb8b50e464687b07bb589dcb9badfd Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Wed, 14 Feb 2024 15:43:25 -0600 Subject: [PATCH 3/6] CI #136 update per my murky package --- .github/workflows/code.yml | 77 ++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 16 deletions(-) diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 12839324..84c325e9 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -1,4 +1,4 @@ -name: Unit Tests +name: CI on: # Triggers the workflow on push or pull request events but only for the main branch @@ -17,29 +17,32 @@ defaults: jobs: lint: - name: Code style + name: Linting & Code style runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" - - name: Install Dependencies + - name: Install package run: | - which python - which pip + set -vxeuo pipefail python -m pip install --upgrade pip - pip install flake8 - - - name: Run flake8 - run: | - flake8 + pip install ruff + + - name: Run ruff + uses: davidslusser/actions_python_ruff@v1.0.0 + with: + # src: "." + # options: "--cov=src" + pip_install_command: "pip install -e .[dev]" + python_version: "3.11" - test-matrix: - name: Python ${{ matrix.python-version }} + tests: + name: CI py${{ matrix.python-version }} runs-on: ubuntu-latest needs: lint strategy: @@ -49,6 +52,7 @@ jobs: - "3.9" - "3.10" - "3.11" + # - "3.12" # 2023-Q4 wait for upstreams to be ready max-parallel: 5 steps: @@ -56,7 +60,9 @@ jobs: run: echo "TZ=America/Chicago" >> "$GITHUB_ENV" - name: Checkout the project from GitHub - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Diagnostics run: | @@ -129,6 +135,7 @@ jobs: - name: Run Bluesky queueserver run: | + set -vxeuo pipefail conda env list pushd ./bluesky/ bash ./qserver.sh run & @@ -140,9 +147,26 @@ jobs: - name: Run tests with pytest & coverage run: | + set -vxeuo pipefail coverage run --concurrency=thread --parallel-mode -m pytest -vvv . coverage combine - coverage report --precision 3 + python -m coverage report --precision 3 + + - name: Force Install coveralls by pip + shell: bash -l {0} + run: | + python -m pip install --force-reinstall coveralls + + - name: Upload coverage data to coveralls.io + shell: bash -l {0} + run: | + set -vxeuo pipefail + python -m coveralls debug + python -m coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.python-version }} + COVERALLS_PARALLEL: true # - name: Gather coverage data from matrix run # shell: bash -l {0} @@ -174,3 +198,24 @@ jobs: # coveralls --service=github --finish # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-support + coveralls: + name: Report unit test coverage to coveralls + needs: tests + runs-on: ubuntu-latest + container: python:3-slim + + steps: + - name: Gather coverage and report to Coveralls + run: | + set -vxeuo pipefail + echo "Finally!" + pip3 install --upgrade coveralls + # debug mode: output prepared json and reported files list to stdout + # https://coveralls-python.readthedocs.io/en/latest/troubleshooting.html + coveralls debug + coveralls --service=github --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file From f9bb07311277986a2ab94b67d2f31e871bd38209 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Wed, 14 Feb 2024 15:49:12 -0600 Subject: [PATCH 4/6] CI #136 restore flake8 linting (for now) --- .github/workflows/code.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 84c325e9..078f4edd 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -31,15 +31,19 @@ jobs: run: | set -vxeuo pipefail python -m pip install --upgrade pip - pip install ruff + pip install ruff flake8 + + - name: Run flake8 + run: flake8 - - name: Run ruff - uses: davidslusser/actions_python_ruff@v1.0.0 - with: - # src: "." - # options: "--cov=src" - pip_install_command: "pip install -e .[dev]" - python_version: "3.11" + # # TODO: will replace flake8 + # - name: Run ruff + # uses: davidslusser/actions_python_ruff@v1.0.0 + # with: + # # src: "." + # # options: "--cov=src" + # pip_install_command: "pip install -e .[dev]" + # python_version: "3.11" tests: name: CI py${{ matrix.python-version }} From 82cfb9eeb23e4b03a3c3d2193bd23068a6632fdd Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Wed, 14 Feb 2024 15:57:19 -0600 Subject: [PATCH 5/6] PKG #263 additional requirement --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 58316373..6e26f70b 100644 --- a/environment.yml +++ b/environment.yml @@ -96,6 +96,7 @@ dependencies: - uvicorn - pip: + - ophyd-registry - tiled - https://github.com/BCDA-APS/adl2pydm/archive/main.zip From c1b58e09dd1365af4a8a29b8c355e703d1c594df Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Wed, 14 Feb 2024 16:07:34 -0600 Subject: [PATCH 6/6] CI #136 remove commented items --- .github/workflows/code.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 078f4edd..06bf7d0d 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -172,37 +172,6 @@ jobs: COVERALLS_FLAG_NAME: ${{ matrix.python-version }} COVERALLS_PARALLEL: true - # - name: Gather coverage data from matrix run - # shell: bash -l {0} - # run: | - # micromamba list coveralls - # which coveralls - # coveralls debug - # coveralls --service=github - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # COVERALLS_FLAG_NAME: ${{ matrix.test-name }} - # COVERALLS_PARALLEL: true - - # # https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-support - # coveralls: - # name: Report unit test coverage to coveralls - # needs: test-matrix - # runs-on: ubuntu-latest - # container: python:3-slim - - # steps: - # - name: Gather coverage and report to Coveralls - # run: | - # echo "Finally!" - # pip3 install --upgrade coveralls - # # debug mode: output prepared json and reported files list to stdout - # # https://coveralls-python.readthedocs.io/en/latest/troubleshooting.html - # # coveralls debug - # coveralls --service=github --finish - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-support coveralls: name: Report unit test coverage to coveralls