Skip to content

Commit

Permalink
test: add macos to CI (#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Sep 18, 2024
1 parent 5496cef commit f8ddf6b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
path: |
~/.local/share/mise/installs
~/.local/share/mise/plugins
key: mise-tools-${{ hashFiles('.mise.toml') }}
restore-keys: mise-tools
key: mise-tools-ubuntu-latest-${{ hashFiles('.mise.toml') }}
restore-keys: mise-tools-ubuntu-latest
- run: mise install
- run: |
set -euxo pipefail
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,17 @@ permissions:

jobs:
unit:
runs-on: ubuntu-latest
#container: ghcr.io/jdx/mise:github-actions
timeout-minutes: 10
strategy:
fail-fast: false
matrix: { os: [ubuntu-latest, macos-latest] }
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN || github.token }}
- if: ${{ env.SCCACHE_S3_NO_CREDENTIALS == '0' }}
run: |
echo "AWS_ACCESS_KEY_ID=$MINIO_AWS_ACCESS_KEY_ID" >> "$GITHUB_ENV"
echo "AWS_SECRET_ACCESS_KEY=$MINIO_AWS_SECRET_ACCESS_KEY" >> "$GITHUB_ENV"
- uses: mozilla-actions/sccache-action@v0.0.4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: stable, components: rustfmt }
- uses: taiki-e/install-action@v2
Expand All @@ -63,8 +60,8 @@ jobs:
- name: cache mise
uses: actions/cache@v4
with:
key: mise-tools-${{ hashFiles('.mise.toml') }}
restore-keys: mise-tools
key: mise-tools-${{ matrix.os }}-${{ hashFiles('.mise.toml') }}
restore-keys: mise-tools-${{ matrix.os }}
path: |
~/.local/share/mise/installs
~/.local/share/mise/plugins
Expand All @@ -80,7 +77,6 @@ jobs:
author_email: 123107610+mise-en-dev@users.noreply.github.com
- uses: actions-rust-lang/rustfmt@v1
- run: mise run lint
- run: ${SCCACHE_PATH} --show-stats

nightly:
runs-on: ubuntu-latest
Expand All @@ -105,8 +101,8 @@ jobs:
- name: cache mise
uses: actions/cache@v4
with:
key: mise-tools-${{ hashFiles('.mise.toml') }}
restore-keys: mise-tools
key: mise-tools-ubuntu-latest-${{ hashFiles('.mise.toml') }}
restore-keys: mise-tools-ubuntu-latest
path: |
~/.local/share/mise/installs
~/.local/share/mise/plugins
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-standalone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mkdir -p "$RELEASE_DIR/$MISE_VERSION"
curl -fsSL "https://mise.jdx.dev/$MISE_VERSION/SHASUMS256.txt" >"$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt"
./scripts/render-install.sh >tmp/install.sh
chmod +x tmp/install.sh
shellcheck tmp/install.sh
mise x shellcheck -- shellcheck tmp/install.sh

./tmp/install.sh
if [[ ! "$("$HOME/.local/bin/mise" -v)" =~ ^${MISE_VERSION//v/} ]]; then
Expand Down
4 changes: 4 additions & 0 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ pub(crate) fn auto_prune() -> Result<()> {
return Ok(());
}
}
let empty = file::ls(*dirs::CACHE).unwrap_or_default().is_empty();
xx::file::touch_dir(&auto_prune_file)?;
if empty {
return Ok(());
}
info!("pruning old cache files, this behavior can be modified with the MISE_CACHE_PRUNE_AGE setting");
prune(
*dirs::CACHE,
Expand Down

0 comments on commit f8ddf6b

Please sign in to comment.