Skip to content

Latest commit

 

History

History
72 lines (57 loc) · 2.2 KB

continuous-integration.md

File metadata and controls

72 lines (57 loc) · 2.2 KB

Continuous integration

You can use Mise in continuous integration environments to provision the environment with the tools the project needs. We recommend that your project pins the tools to a specific version to ensure the environment is reproducible.

Any CI provider

Continuous integration pipelines allow running arbitrary commands. You can use this to install Mise and run mise install to install the tools:

script: |
  curl https://mise.jdx.dev/install.sh | sh
  mise install

To ensure you run the version of the tools installed by Mise, make sure you run them through the mise x command:

script: |
  mise x npm -- test

Alternatively, you can add the shims directory to your PATH, if the CI provider allows it.

GitHub Actions

If you use GitHub Actions, we provide a mise-action that wraps the installation of Mise and the tools. All you need to do is to add the action to your workflow:

name: test
on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: jdx/mise-action@v2
        with:
          version: 2023.12.0 # [default: latest] mise version to install
          install: true # [default: true] run `mise install`
          cache: true # [default: true] cache mise using GitHub's cache
          # automatically write this .tool-versions file
          experimental: true # [default: false] enable experimental features
          tool_versions: |
            shellcheck 0.9.0
          # or, if you prefer .mise.toml format:
          mise_toml: |
            [tools]
            shellcheck = "0.9.0"
      - run: shellcheck scripts/*.sh

Xcode Cloud

If you are using Xcode Cloud, you can use custom ci_post_clone.sh build script to install Mise. Here's an example:

#!/bin/sh
curl https://mise.jdx.dev/install.sh | sh
export PATH="$HOME/.local/bin/bin:$PATH"

mise install # Installs the tools in .mise.toml
eval "$(mise activate bash --shims)" # Addds the activated tools to $PATH

swiftlint {args}