-
Notifications
You must be signed in to change notification settings - Fork 284
88 lines (73 loc) · 2.42 KB
/
1.249-lcm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Build and test (1.249-lcm, scheduled)
on:
schedule:
# run every Monday, this refreshes the cache
- cron: '13 2 * * 1'
jobs:
python-test:
name: Python tests
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
test: ["", "-3"]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: '1.249-lcm'
- name: Run python tests
run: bash .github/python-nosetests${{ matrix.test }}.sh
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@v3
with:
ref: '1.249-lcm'
- 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
- name: Load environment file
id: dotenv
uses: falti/[email protected]
- 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@v3
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
run: sudo apt-get update
- name: Use ocaml
uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ steps.dotenv.outputs.ocaml_version_full }}
opam-repository: ${{ steps.dotenv.outputs.repository }}
- 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
- name: Build
run: |
opam exec -- ./configure
opam exec -- make
env:
XAPI_VERSION: "v1.249.0-${{ github.sha }}"
- name: Run tests
run: opam exec -- make test
- 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 }}