Skip to content

Commit

Permalink
Merge pull request #5575 from psafont/streamliner
Browse files Browse the repository at this point in the history
ci: reduce noise generated for PRs
  • Loading branch information
robhoes authored Apr 23, 2024
2 parents bbefd9a + e677c05 commit 09b4bdb
Show file tree
Hide file tree
Showing 9 changed files with 254 additions and 126 deletions.
41 changes: 15 additions & 26 deletions .github/workflows/1.249-lcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ jobs:
ocaml-test:
name: Ocaml tests
runs-on: ubuntu-20.04
env:
package: "xapi-cli-protocol xapi-client xapi-consts xapi-database xapi-datamodel xapi-types xapi xe"

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: '1.249-lcm'

- name: Free space
shell: bash
run: sudo rm -rf /usr/local/lib/android

- name: Pull configuration from xs-opam
run: |
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/release/yangtze/lcm/tools/xs-opam-ci.env | cut -f2 -d " " > .env
Expand All @@ -42,37 +44,24 @@ jobs:
id: dotenv
uses: falti/dotenv-action@v1

- name: Retrieve date for cache key (year-week)
id: cache-key
run: echo "date=$(/bin/date -u "+%Y%W")" >> $GITHUB_OUTPUT
shell: bash

- name: Restore opam cache
id: opam-cache
uses: actions/cache@v4
with:
path: "~/.opam"
# invalidate cache every week, gets built using a scheduled job
key: ${{ steps.cache-key.outputs.date }}-1.249

- name: Update Ubuntu repositories
shell: bash
run: sudo apt-get update

- name: Use ocaml
uses: avsm/setup-ocaml@v1
uses: ocaml/setup-ocaml@v2
with:
ocaml-version: ${{ steps.dotenv.outputs.ocaml_version_full }}
opam-repository: ${{ steps.dotenv.outputs.repository }}
ocaml-compiler: ${{ steps.dotenv.outputs.ocaml_version_full }}
opam-repositories: |
xs-opam: ${{ steps.dotenv.outputs.repository }}
dune-cache: true

- name: Install dependencies
run: |
opam update
opam pin add . --no-action
opam depext -u ${{ env.package }}
opam upgrade
opam install ${{ env.package }} --deps-only --with-test -v
shell: bash
run: opam install . --deps-only --with-test -v

- name: Build
- name: Configure and build
shell: bash
run: |
opam exec -- ./configure
opam exec -- make
Expand All @@ -85,4 +74,4 @@ jobs:
- name: Avoid built packages to appear in the cache
# only packages in this repository follow a branch, the rest point
# to a tag
run: opam uninstall ${{ env.package }}
run: opam pin list --short | xargs opam unpin
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
opam exec -- dune exec ocaml/xapi-storage/generator/src/main.exe -- gen_markdown --path=$STORAGE_DOCDIR
- name: Deploy xapi-storage docs
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_STORAGE_DEPLOY_KEY }}
publish_dir: ${{ env.STORAGE_DOCDIR }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.119.0'

Expand All @@ -24,7 +24,7 @@ jobs:
hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DOCS_DEPLOY_KEY }}
publish_dir: ./doc/public
Expand Down
26 changes: 8 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- run: echo "::add-matcher::.github/workflows/python-warning-matcher.json"
name: "Setup GitHub for reporting Python warnings as annotations in pull request code review"

- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
name: Run pre-commit checks (no spaces at end of lines, etc)
if: ${{ matrix.python-version != '2.7' }}
with:
Expand All @@ -51,7 +51,7 @@ jobs:

- name: Install dependencies only needed for python 3
if: ${{ matrix.python-version != '2.7' }}
run: pip install pandas pytype toml wrapt
run: pip install opentelemetry-api opentelemetry-exporter-zipkin-json opentelemetry-sdk pandas pytype toml wrapt

- name: Install common dependencies for Python ${{matrix.python-version}}
run: pip install future mock pytest-coverage pytest-mock
Expand Down Expand Up @@ -98,6 +98,7 @@ jobs:
level: warning
# To be customized to cover remaining Python scripts:
glob_pattern: "**/*.py"
continue-on-error: true

- name: Run pytype checks
if: ${{ matrix.python-version != '2.7' }}
Expand All @@ -107,16 +108,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTYPE_REPORTER_DEBUG: True

# Try to add pytype_report.py's summary file as a comment to the PR:
# Documentation: https://github.com/marketplace/actions/add-pr-comment
- name: Add the pytype summary as a comment to the PR (if permitted)
uses: mshick/add-pr-comment@v2
# Depends on pytype checks, which are not run for python 2.7:
if: ${{ matrix.python-version != '2.7' }}
# Fails for user workflows without permissions(fork-based pull requests):
continue-on-error: true
- name: pyflakes
uses: reviewdog/action-pyflakes@v1
with:
message-path: .git/pytype-summary.md # Add the content of it as comment
github_token: ${{ secrets.github_token }}
continue-on-error: true


ocaml-tests:
name: Run OCaml tests
Expand Down Expand Up @@ -173,13 +170,6 @@ jobs:
- name: quality-gate
run: make quality-gate

- name: pyflakes
uses: reviewdog/action-pyflakes@master
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: error

test-sdk-builds:
name: Test SDK builds
uses: ./.github/workflows/generate-and-build-sdks.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4

- name: Use python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand Down
Loading

0 comments on commit 09b4bdb

Please sign in to comment.