Skip to content

Commit

Permalink
Merge pull request #5814 from stephenchengCloud/private/stephenche/sy…
Browse files Browse the repository at this point in the history
…nc_xs9_with_master

Routine sync xs9 with master
  • Loading branch information
gangj authored Jul 12, 2024
2 parents 3921246 + 240a56c commit 9bf0e46
Show file tree
Hide file tree
Showing 9,068 changed files with 43,758 additions and 16,646 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
42 changes: 7 additions & 35 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,7 @@ coverage:
# - excluding: **/test_*.py
#
paths: ["python3/**", "!**/test_*.py"]

#
# For python3/** (excluding tests):
#
# For python3, coverage should not be reduced compared to its base:
#
target: auto
target: 80%

#
# Exception: the threshold value given is allowed
Expand All @@ -183,27 +177,13 @@ coverage:
#
threshold: 20%

# Checks each Python version separately:
python-3.11:
flags: ["python3.11"]
python-2.7:
flags: ["python2.7"]

#
# Project limits
# --------------
# These checks are relative to all code, not the changes (not the diff of the PR)
#
project:

#
# Python modules and scripts below scripts/ (excluding tests)
#
scripts:
paths: ["scripts/**", "!**/test_*.py"]
target: 48%
threshold: 2%

#
# Python modules and scripts below ocaml/ (excluding tests)
#
Expand All @@ -226,7 +206,7 @@ coverage:
tests:
# Ensure that all tests are executed (tests themselves must be 100% covered)
target: 98%
paths: ["**/test_*.py"]
paths: ["python3/tests/test_*.py"]


#
Expand All @@ -243,24 +223,15 @@ component_management:
- type: project
# `auto` will use the coverage from the base commit (pull request base
# or parent commit) coverage to compare against.
target: auto
target: 48
threshold: 2%

- type: patch
target: auto
threshold: 10%
target: 80
threshold: 5%

individual_components:

- component_id: scripts # this is an identifier that should not be changed
name: scripts # this is a display name, and can be changed freely
# The list of paths that should be in- and excluded in this component:
paths: ["scripts/**", "!scripts/examples/**", "!**/test_*.py"]

- component_id: scripts/examples
name: scripts/examples
paths: ["scripts/examples/**", "!scripts/**/test_*.py"]

- component_id: ocaml
name: ocaml
paths: ["ocaml/**", "!**/test_*.py"]
Expand All @@ -278,4 +249,5 @@ component_management:

- component_id: test_cases
name: test_cases
paths: ["**/test_*.py"]
paths: ["python3/tests/test_*.py"]

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
13 changes: 0 additions & 13 deletions .github/workflows/cleanup-xapi-environment/action.yml

This file was deleted.

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
49 changes: 47 additions & 2 deletions .github/workflows/generate-and-build-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ jobs:
shell: bash
run: opam exec -- make sdk

- name: Run CI for SDKs
uses: ./.github/workflows/sdk-ci

- name: Store C SDK source
uses: actions/upload-artifact@v4
with:
name: SDK_Source_C
path: |
_build/install/default/xapi/sdk/c/*
!_build/install/default/xapi/sdk/c/dune
- name: Store C# SDK source
uses: actions/upload-artifact@v4
with:
Expand All @@ -36,8 +47,42 @@ jobs:
name: SDK_Source_PowerShell
path: _build/install/default/xapi/sdk/powershell/*

- name: Cleanup XenAPI environment
uses: ./.github/workflows/cleanup-xapi-environment
- name: Store Go SDK Artifacts
uses: actions/upload-artifact@v4
with:
name: SDK_Artifacts_Go
path: |
_build/install/default/xapi/sdk/go/*
!_build/install/default/xapi/sdk/go/dune
- name: Trim dune cache
run: opam exec -- dune cache trim --size=2GiB

build-c-sdk:
name: Build C SDK
runs-on: ubuntu-latest
needs: generate-sdk-sources
steps:
- name: Install dependencies
run: sudo apt-get install libxml2-dev

- name: Retrieve C SDK source
uses: actions/download-artifact@v4
with:
name: SDK_Source_C
path: source/

- name: Build C SDK
shell: bash
run: make -C source

- name: Store C SDK
uses: actions/upload-artifact@v4
with:
name: SDK_Artifacts_C
path: |
source/*
!source/src/*.o
build-csharp-sdk:
name: Build C# SDK
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/go-ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Run CI for Go SDK'
runs:
using: 'composite'
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'

- name: Lint for Go SDK
uses: golangci/golangci-lint-action@v4
with:
version: v1.57.2
working-directory: ${{ github.workspace }}/_build/install/default/xapi/sdk/go/src
args: --config=${{ github.workspace }}/.golangci.yml

- name: Run CI for Go SDK
shell: bash
run: |
cd ./ocaml/sdk-gen/component-test/
cp -r ${{ github.workspace }}/_build/install/default/xapi/sdk/go/src jsonrpc-client/go/goSDK
bash run-tests.sh
6 changes: 3 additions & 3 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
uses: actions/checkout@v4

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

- name: Build
run: |
cd doc
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
Loading

0 comments on commit 9bf0e46

Please sign in to comment.