Skip to content

Commit

Permalink
ci: remove warnings about outdated node versions
Browse files Browse the repository at this point in the history
Signed-off-by: Pau Ruiz Safont <[email protected]>
  • Loading branch information
psafont committed Apr 19, 2024
1 parent 31e1153 commit 473efd0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 37 deletions.
47 changes: 18 additions & 29 deletions .github/workflows/1.249-lcm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,49 @@ jobs:
test: ["", "-3"]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- 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@v2
uses: actions/checkout@v4

- 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
- name: Load environment file
id: dotenv
uses: falti/[email protected]

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

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

- 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 @@ -80,4 +69,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
18 changes: 10 additions & 8 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,31 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- 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/dotenv-action@v0.2.7
uses: falti/dotenv-action@v1

- name: Update Ubuntu repositories
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
opam-pin: false
opam-depext: false

- name: Install ocamlformat
run: |
opam update
opam install ocamlformat
run: opam install ocamlformat

- name: Check whether `make format` was run
run: opam exec -- dune build @fmt

0 comments on commit 473efd0

Please sign in to comment.