Skip to content

Commit a3e971b

Browse files
authored
Merge pull request #765 from psafont/lcm-scheduled
2 parents 60a56c5 + 067ad3a commit a3e971b

File tree

3 files changed

+88
-3
lines changed

3 files changed

+88
-3
lines changed

.github/workflows/0.150-lcm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ jobs:
3434

3535
- name: Pull configuration from xs-opam
3636
run: |
37-
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/release/stockholm/lcm/tools/xs-opam-ci.env | cut -f2 -d " " > .env
37+
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/release/yangtze/lcm/tools/xs-opam-ci.env | cut -f2 -d " " > .env
3838
3939
- name: Load environment file
4040
id: dotenv
41-
uses: falti/dotenv-action@v0.2.4
41+
uses: falti/dotenv-action@v0.2.6
4242

4343
- name: Retrieve date for cache key (year-week)
4444
id: cache-key

.github/workflows/0.150.5-lcm.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build and test (0.150.5-lcm, scheduled)
2+
3+
on:
4+
schedule:
5+
# run every Monday, this refreshes the cache
6+
- cron: '5 2 * * 1'
7+
8+
jobs:
9+
python-test:
10+
name: Python tests
11+
runs-on: ubuntu-20.04
12+
strategy:
13+
fail-fast: false
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
with:
18+
ref: '0.150.5-lcm'
19+
20+
- name: Run python tests
21+
run: bash .github/python-nosetests.sh
22+
23+
ocaml-test:
24+
name: Ocaml tests
25+
runs-on: ubuntu-20.04
26+
env:
27+
package: "xapi-xenopsd xapi-xenopsd-simulator xapi-xenopsd-cli xapi-xenopsd-xc"
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v2
32+
with:
33+
ref: '0.150.5-lcm'
34+
35+
- name: Pull configuration from xs-opam
36+
run: |
37+
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/release/stockholm/lcm/tools/xs-opam-ci.env | cut -f2 -d " " > .env
38+
39+
- name: Load environment file
40+
id: dotenv
41+
uses: falti/dotenv-action@v0.2.6
42+
43+
- name: Retrieve date for cache key (year-week)
44+
id: cache-key
45+
run: echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
46+
shell: bash
47+
48+
- name: Restore opam cache
49+
id: opam-cache
50+
uses: actions/cache@v2
51+
with:
52+
path: "~/.opam"
53+
# invalidate cache daily, gets built daily using a scheduled job
54+
key: ${{ steps.cache-key.outputs.date }}-0.150.5
55+
56+
- name: Use ocaml
57+
uses: avsm/setup-ocaml@v1
58+
with:
59+
ocaml-version: ${{ steps.dotenv.outputs.ocaml_version_full }}
60+
opam-repository: ${{ steps.dotenv.outputs.repository }}
61+
62+
- name: Update opam metadata
63+
run: |
64+
opam update
65+
opam pin add . --no-action
66+
67+
- name: Install external dependencies
68+
run: opam depext -u ${{ env.package }}
69+
70+
- name: Install dependencies
71+
run: |
72+
opam upgrade
73+
opam install ${{ env.package }} --deps-only --with-test -v
74+
75+
- name: Build
76+
run: |
77+
opam exec -- ./configure
78+
opam exec -- make
79+
80+
- name: Run tests
81+
run: opam exec -- make test
82+
83+
- name: Avoid built packages to appear in the cache
84+
# only packages in this repository follow a branch, the rest point to a tag
85+
run: opam uninstall ${{ env.package }}

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
3737
- name: Load environment file
3838
id: dotenv
39-
uses: falti/dotenv-action@v0.2.4
39+
uses: falti/dotenv-action@v0.2.6
4040

4141
- name: Retrieve date for cache key
4242
id: cache-key

0 commit comments

Comments
 (0)