Skip to content

Commit faf1ee6

Browse files
hhugokit-ty-katesmorimotodra27
committed
Add initial support for opam 2.2 on Windows
Co-authored-by: Kate <[email protected]> Co-authored-by: Sora Morimoto <[email protected]> Co-authored-by: David Allsopp <[email protected]>
1 parent 970719e commit faf1ee6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+699
-2158
lines changed

.github/workflows/workflow.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,12 @@ jobs:
4949
os:
5050
- macos-latest
5151
- ubuntu-latest
52+
- windows-latest
5253
ocaml-compiler:
5354
- "5.2"
54-
allow-prerelease-opam:
55-
- false
5655
include:
57-
- os: windows-latest
58-
ocaml-compiler: ocaml-variants.5.2.0+options,ocaml-option-mingw
59-
allow-prerelease-opam: false
60-
opam-repositories: |
61-
windows-5.0: https://github.com/dra27/opam-repository.git#windows-5.0
62-
sunset: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
63-
default: https://github.com/ocaml/opam-repository.git
6456
- os: ubuntu-latest
6557
ocaml-compiler: ocaml-variants.5.2.0+options,ocaml-option-flambda
66-
allow-prerelease-opam: true
6758

6859
runs-on: ${{ matrix.os }}
6960

@@ -75,8 +66,6 @@ jobs:
7566
uses: ./
7667
with:
7768
ocaml-compiler: ${{ matrix.ocaml-compiler }}
78-
allow-prerelease-opam: ${{ matrix.allow-prerelease-opam }}
79-
dune-cache: ${{ runner.os != 'Windows' }}
80-
opam-repositories: ${{ matrix.opam-repositories }}
69+
allow-prerelease-opam: true
8170

82-
- run: opam depext --install uri
71+
- run: opam install uri

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to
88

99
## [unreleased]
1010

11+
### Added
12+
13+
- Add initial support for opam 2.2 on Windows.
14+
1115
## [2.2.10]
1216

1317
### Changed

EXAMPLES.md

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -59,55 +59,6 @@ jobs:
5959
uses: actions/deploy-pages@v4
6060
```
6161
62-
## Using several conditional setup steps
63-
64-
```yml
65-
steps:
66-
- name: Checkout tree
67-
uses: actions/checkout@v4
68-
69-
- name: Set-up OCaml on Windows
70-
uses: ocaml/setup-ocaml@v2
71-
if: runner.os == 'Windows'
72-
with:
73-
opam-repositories: |
74-
sunset: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
75-
default: https://github.com/ocaml/opam-repository.git
76-
77-
- name: Set-up OCaml on Unix
78-
uses: ocaml/setup-ocaml@v2
79-
if: runner.os != 'Windows'
80-
with:
81-
opam-repositories: |
82-
default: https://github.com/ocaml/opam-repository.git
83-
```
84-
85-
## Using a custom step to choose between the values
86-
87-
```yml
88-
steps:
89-
- name: Checkout tree
90-
uses: actions/checkout@v4
91-
92-
- name: Set opam repository url
93-
id: repository
94-
shell: bash
95-
run: |
96-
if [ "$RUNNER_OS" == "Windows" ]; then
97-
echo "::set-output name=url::https://github.com/ocaml-opam/opam-repository-mingw.git#sunset"
98-
elif [ "$RUNNER_OS" == "macOS" ]; then
99-
echo "::set-output name=url::https://github.com/custom/opam-repository.git#macOS"
100-
else
101-
echo "::set-output name=url::https://github.com/ocaml/opam-repository.git"
102-
fi
103-
104-
- name: Set-up OCaml with repository ${{ steps.repository.outputs.url }}
105-
uses: ocaml/setup-ocaml@v2
106-
with:
107-
opam-repositories: |
108-
default: ${{ steps.repository.outputs.url }}
109-
```
110-
11162
## Using glob patterns to filter local packages
11263
11364
Consult the

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,16 @@ steps:
9797

9898
## Inputs
9999

100-
| Name | Required | Description | Type | Default |
101-
| ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
102-
| `ocaml-compiler` | Yes | The OCaml compiler packages to initialise. Consult the [supported version syntax](#supported-version-syntax) section. | string | |
103-
| `opam-repositories` | No | The name and URL pair of the repository to fetch the packages from. | string | |
104-
| `opam-pin` | No | Enable the automation feature for opam pin. | bool | `true` |
105-
| `opam-depext` | No | Enable the automation feature for opam depext. | bool | `true` |
106-
| `opam-depext-flags` | No | The flags for the opam depext command. The flags must be separated by the comma. | string | |
107-
| `opam-local-packages` | No | The local packages to be used by `opam-pin` or `opam-depext`. Consult the [`@actions/glob` documentation](https://github.com/actions/toolkit/tree/main/packages/glob) package for supported patterns. | string | `*.opam` |
108-
| `opam-disable-sandboxing` | No | Disable the opam sandboxing feature. | bool | `false` |
109-
| `dune-cache` | No | Enable the dune cache feature. This feature **_requires_** dune 2.8.5 or later on the Windows runners. | bool | `false` |
110-
| `cache-prefix` | No | The prefix of the cache keys. | string | `v1` |
111-
| `allow-prerelease-opam` | No | Allow to use a pre-release version of opam. | bool | `false` |
100+
| Name | Required | Description | Type | Default |
101+
| ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | -------- |
102+
| `ocaml-compiler` | Yes | The OCaml compiler packages to initialise. Consult the [supported version syntax](#supported-version-syntax) section. | string | |
103+
| `opam-repositories` | No | The name and URL pair of the repository to fetch the packages from. | string | |
104+
| `opam-pin` | No | Enable the automation feature for opam pin. | bool | `true` |
105+
| `opam-local-packages` | No | The local packages to be used by `opam-pin`. Consult the [`@actions/glob` documentation](https://github.com/actions/toolkit/tree/main/packages/glob) package for supported patterns. | string | `*.opam` |
106+
| `opam-disable-sandboxing` | No | Disable the opam sandboxing feature. | bool | `false` |
107+
| `dune-cache` | No | Enable the dune cache feature. This feature **_requires_** dune 2.8.5 or later on the Windows runners. | bool | `false` |
108+
| `cache-prefix` | No | The prefix of the cache keys. | string | `v1` |
109+
| `allow-prerelease-opam` | No | Allow to use a pre-release version of opam. | bool | `false` |
112110

113111
### Supported version syntax
114112

@@ -122,12 +120,11 @@ more detailed examples please refer to the
122120

123121
Examples:
124122

125-
- Exact package name: `ocaml-base-compiler.5.2.0`,
126-
`ocaml-variants.4.14.2+mingw64c`
123+
- Exact package name: `ocaml-base-compiler.5.2.0`
127124
- Combine multiple packages:
128125
`ocaml-variants.5.2.0+options,ocaml-option-flambda,ocaml-option-musl,ocaml-option-static`
129126
- Minor versions: `4.08`, `4.14`, `5.2`, `5.2.x`
130-
- More specific versions: `~4.02.2`, `5.1.0`,
127+
- More specific versions: `~4.02.2`, `5.1.0`
131128

132129
## Advanced Configurations
133130

action.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,8 @@ inputs:
2020
description: Enable the automation feature for opam pin.
2121
required: false
2222
default: "true"
23-
opam-depext:
24-
description: Enable the automation feature for opam depext.
25-
required: false
26-
default: "true"
27-
opam-depext-flags:
28-
description: The flags for the opam depext command.
29-
required: false
30-
default: ""
3123
opam-local-packages:
32-
description: The local packages to be used by `opam-pin` or `opam-depext`.
24+
description: The local packages to be used by `opam-pin`.
3325
required: false
3426
default: "*.opam"
3527
opam-disable-sandboxing:

analysis/dist/index.js

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

biome.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
"linter": {
1111
"enabled": true,
1212
"rules": {
13-
"recommended": true,
14-
"complexity": {
15-
"useLiteralKeys": "off"
16-
}
13+
"recommended": true
1714
}
1815
},
1916
"organizeImports": {

0 commit comments

Comments
 (0)