Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for opam 2.2 on Windows #794

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,12 @@ jobs:
os:
- macos-latest
- ubuntu-latest
smorimoto marked this conversation as resolved.
Show resolved Hide resolved
- windows-latest
ocaml-compiler:
- "5.2"
allow-prerelease-opam:
- false
include:
- os: windows-latest
ocaml-compiler: ocaml-variants.5.2.0+options,ocaml-option-mingw
allow-prerelease-opam: false
opam-repositories: |
windows-5.0: https://github.com/dra27/opam-repository.git#windows-5.0
sunset: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
- os: ubuntu-latest
ocaml-compiler: ocaml-variants.5.2.0+options,ocaml-option-flambda
allow-prerelease-opam: true

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

Expand All @@ -75,8 +66,6 @@ jobs:
uses: ./
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
allow-prerelease-opam: ${{ matrix.allow-prerelease-opam }}
dune-cache: ${{ runner.os != 'Windows' }}
opam-repositories: ${{ matrix.opam-repositories }}
allow-prerelease-opam: true

- run: opam depext --install uri
- run: opam install uri
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to

## [unreleased]

### Added

- Add initial support for opam 2.2 on Windows.

## [2.2.10]

### Changed
Expand Down
49 changes: 0 additions & 49 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,55 +59,6 @@ jobs:
uses: actions/deploy-pages@v4
```
## Using several conditional setup steps
```yml
steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml on Windows
uses: ocaml/setup-ocaml@v2
if: runner.os == 'Windows'
with:
opam-repositories: |
sunset: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
- name: Set-up OCaml on Unix
uses: ocaml/setup-ocaml@v2
if: runner.os != 'Windows'
with:
opam-repositories: |
default: https://github.com/ocaml/opam-repository.git
```
## Using a custom step to choose between the values
```yml
steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set opam repository url
id: repository
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
echo "::set-output name=url::https://github.com/ocaml-opam/opam-repository-mingw.git#sunset"
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "::set-output name=url::https://github.com/custom/opam-repository.git#macOS"
else
echo "::set-output name=url::https://github.com/ocaml/opam-repository.git"
fi
- name: Set-up OCaml with repository ${{ steps.repository.outputs.url }}
uses: ocaml/setup-ocaml@v2
with:
opam-repositories: |
default: ${{ steps.repository.outputs.url }}
```
## Using glob patterns to filter local packages
Consult the
Expand Down
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,16 @@ steps:

## Inputs

| Name | Required | Description | Type | Default |
| ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
| `ocaml-compiler` | Yes | The OCaml compiler packages to initialise. Consult the [supported version syntax](#supported-version-syntax) section. | string | |
| `opam-repositories` | No | The name and URL pair of the repository to fetch the packages from. | string | |
| `opam-pin` | No | Enable the automation feature for opam pin. | bool | `true` |
| `opam-depext` | No | Enable the automation feature for opam depext. | bool | `true` |
| `opam-depext-flags` | No | The flags for the opam depext command. The flags must be separated by the comma. | string | |
| `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` |
| `opam-disable-sandboxing` | No | Disable the opam sandboxing feature. | bool | `false` |
| `dune-cache` | No | Enable the dune cache feature. This feature **_requires_** dune 2.8.5 or later on the Windows runners. | bool | `false` |
| `cache-prefix` | No | The prefix of the cache keys. | string | `v1` |
| `allow-prerelease-opam` | No | Allow to use a pre-release version of opam. | bool | `false` |
| Name | Required | Description | Type | Default |
| ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ | -------- |
| `ocaml-compiler` | Yes | The OCaml compiler packages to initialise. Consult the [supported version syntax](#supported-version-syntax) section. | string | |
| `opam-repositories` | No | The name and URL pair of the repository to fetch the packages from. | string | |
| `opam-pin` | No | Enable the automation feature for opam pin. | bool | `true` |
| `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` |
| `opam-disable-sandboxing` | No | Disable the opam sandboxing feature. | bool | `false` |
| `dune-cache` | No | Enable the dune cache feature. This feature **_requires_** dune 2.8.5 or later on the Windows runners. | bool | `false` |
| `cache-prefix` | No | The prefix of the cache keys. | string | `v1` |
| `allow-prerelease-opam` | No | Allow to use a pre-release version of opam. | bool | `false` |

### Supported version syntax

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

Examples:

- Exact package name: `ocaml-base-compiler.5.2.0`,
`ocaml-variants.4.14.2+mingw64c`
- Exact package name: `ocaml-base-compiler.5.2.0`
- Combine multiple packages:
`ocaml-variants.5.2.0+options,ocaml-option-flambda,ocaml-option-musl,ocaml-option-static`
- Minor versions: `4.08`, `4.14`, `5.2`, `5.2.x`
- More specific versions: `~4.02.2`, `5.1.0`,
- More specific versions: `~4.02.2`, `5.1.0`

## Advanced Configurations

Expand Down
10 changes: 1 addition & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,8 @@ inputs:
description: Enable the automation feature for opam pin.
required: false
default: "true"
opam-depext:
description: Enable the automation feature for opam depext.
required: false
default: "true"
opam-depext-flags:
description: The flags for the opam depext command.
required: false
default: ""
opam-local-packages:
description: The local packages to be used by `opam-pin` or `opam-depext`.
description: The local packages to be used by `opam-pin`.
required: false
default: "*.opam"
opam-disable-sandboxing:
Expand Down
13 changes: 7 additions & 6 deletions analysis/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"useLiteralKeys": "off"
}
"recommended": true
}
},
"organizeImports": {
Expand Down
25 changes: 0 additions & 25 deletions dist/LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading