Skip to content

Commit 9923a88

Browse files
authored
Update GitHub Actions (#1268)
* Update GitHub Actions Signed-off-by: Sora Morimoto <sora@morimoto.io>
1 parent 7bcea63 commit 9923a88

File tree

4 files changed

+68
-66
lines changed

4 files changed

+68
-66
lines changed

.github/dependabot.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
labels:
8+
- dependencies
9+
- no changelog
10+
- package-ecosystem: npm
11+
directory: /ocaml-lsp-server/test/e2e
12+
schedule:
13+
interval: daily
14+
labels:
15+
- dependencies
16+
- no changelog

.github/workflows/build-and-test.yml

+31-45
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
-master
7+
- master
88
schedule:
99
# Prime the caches every Monday
1010
- cron: 0 1 * * MON
@@ -17,22 +17,19 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os:
20-
- macos-latest
2120
- ubuntu-latest
22-
- windows-latest
2321
ocaml-compiler:
24-
- 4.14.x
25-
- 5.0.x
26-
- 5.1.x
27-
exclude:
28-
- os: windows-latest
29-
ocaml-compiler: 5.0.x
30-
- os: windows-latest
31-
ocaml-compiler: 5.1.x
22+
- "4.14"
23+
- "5.0"
24+
- "5.1"
25+
include:
3226
- os: macos-latest
33-
ocaml-compiler: 5.0.x
34-
- os: macos-latest
35-
ocaml-compiler: 5.1.x
27+
ocaml-compiler: "4.14"
28+
- os: windows-latest
29+
ocaml-compiler: "4.14"
30+
opam-repositories: |
31+
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
32+
default: https://github.com/ocaml/opam-repository.git
3633
3734
runs-on: ${{ matrix.os }}
3835

@@ -42,81 +39,70 @@ jobs:
4239
git config --global core.autocrlf false
4340
git config --global core.eol lf
4441
45-
- name: Checkout code
46-
uses: actions/checkout@v3
42+
- name: Checkout tree
43+
uses: actions/checkout@v4
4744
with:
4845
submodules: true
4946

50-
- name: Use latest LTS Node.js release
51-
uses: actions/setup-node@v3
47+
- name: Set-up Node.js
48+
uses: actions/setup-node@v4
5249
with:
53-
node-version: 16.x
50+
node-version: lts/*
5451

5552
- name: Install npm packages
5653
run: yarn --frozen-lockfile
5754
working-directory: ocaml-lsp-server/test/e2e
5855

59-
- name: Use OCaml ${{ matrix.ocaml-compiler }}
60-
uses: ocaml/setup-ocaml@v2
61-
if: matrix.os != 'windows-latest'
62-
with:
63-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
64-
65-
- name: Use OCaml ${{ matrix.ocaml-compiler }} (Win)
56+
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
6657
uses: ocaml/setup-ocaml@v2
67-
if: matrix.os == 'windows-latest'
6858
with:
6959
ocaml-compiler: ${{ matrix.ocaml-compiler }}
70-
opam-repositories: |
71-
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
72-
default: https://github.com/ocaml/opam-repository.git
60+
allow-prerelease-opam: true
61+
opam-repositories: ${{ matrix.opam-repositories }}
7362

74-
- name: Build and install opam packages
63+
- name: Build and install dependencies
7564
run: opam install .
7665

7766
# the makefile explains why we don't use --with-test
7867
# ppx expect is not yet compatible with 5.1 and test output vary from one
7968
# compiler to another. We only test on 4.14.
8069
- name: Install test dependencies
81-
if: matrix.ocaml-compiler == '4.14.x'
70+
if: matrix.ocaml-compiler == '4.14'
8271
run: opam exec -- make install-test-deps
8372

8473
- name: Run build @all
85-
if: matrix.ocaml-compiler == '4.14.x'
74+
if: matrix.ocaml-compiler == '4.14'
8675
run: opam exec -- make all
8776

8877
- name: Run the unit tests
89-
if: matrix.ocaml-compiler == '4.14.x'
78+
if: matrix.ocaml-compiler == '4.14'
9079
run: opam exec -- make test-ocaml
9180

9281
- name: Run the template integration tests
93-
if: matrix.ocaml-compiler == '4.14.x'
82+
if: matrix.ocaml-compiler == '4.14'
9483
run: opam exec -- make test-e2e
9584

9685
coverage:
9786
name: Coverage
9887
runs-on: ubuntu-latest
99-
strategy:
100-
fail-fast: false
101-
matrix:
102-
ocaml-compiler:
103-
- 4.14.x
10488
steps:
105-
- uses: actions/checkout@v3
89+
- name: Checkout tree
90+
uses: actions/checkout@v4
10691
with:
10792
submodules: true
108-
- name: Use OCaml ${{ matrix.ocaml-compiler }}
93+
94+
- name: Set-up OCaml
10995
uses: ocaml/setup-ocaml@v2
11096
with:
111-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
112-
opam-depext: false
97+
ocaml-compiler: "4.14"
98+
allow-prerelease-opam: true
11399

114100
- name: Set git user
115101
run: |
116102
git config --global user.name github-actions[bot]
117103
git config --global user.email github-actions[bot]@users.noreply.github.com
118104
119-
- name: Install deps on Unix
105+
- name: Install dependencies
120106
run: |
121107
opam install . --deps-only
122108
opam exec -- make coverage-deps install-test-deps

.github/workflows/changelog.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Changelog check
22

33
on:
44
pull_request:
5-
branches: [ master ]
6-
types: [ opened, synchronize, reopened, labeled, unlabeled ]
5+
branches: [master]
6+
types: [opened, synchronize, reopened, labeled, unlabeled]
77

88
jobs:
99
Changelog-Entry-Check:
1010
name: Check Changelog Action
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
1212
steps:
1313
- uses: tarides/changelog-check-action@v2

.github/workflows/nix.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ jobs:
88
tests:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout code
12-
uses: actions/checkout@v3
13-
with:
14-
submodules: true
15-
- name: nix
16-
uses: cachix/install-nix-action@v21
17-
with:
18-
nix_path: nixpkgs=channel:nixos-unstable
19-
- run: nix develop -c make nix-tests
11+
- name: Checkout tree
12+
uses: actions/checkout@v4
13+
with:
14+
submodules: true
15+
- name: nix
16+
uses: cachix/install-nix-action@v26
17+
with:
18+
nix_path: nixpkgs=channel:nixos-unstable
19+
- run: nix develop -c make nix-tests
2020
fmt:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- name: Checkout code
24-
uses: actions/checkout@v3
25-
with:
26-
submodules: true
27-
- name: nix
28-
uses: cachix/install-nix-action@v21
29-
with:
30-
nix_path: nixpkgs=channel:nixos-unstable
31-
- run: nix develop -c make nix-fmt
23+
- name: Checkout tree
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: true
27+
- name: nix
28+
uses: cachix/install-nix-action@v26
29+
with:
30+
nix_path: nixpkgs=channel:nixos-unstable
31+
- run: nix develop -c make nix-fmt

0 commit comments

Comments
 (0)