chore: update GitHub Actions workflows and dependencies #24831
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test | |
| on: | |
| push: | |
| tags: ["v*"] | |
| branches: ["main", "mise"] | |
| pull_request: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| workflow_call: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name != 'push' }} | |
| env: | |
| CARGO_TERM_COLOR: always | |
| MISE_TRUSTED_CONFIG_PATHS: ${{ github.workspace }} | |
| MISE_EXPERIMENTAL: 1 | |
| MISE_LOCKFILE: 1 | |
| RUST_BACKTRACE: 1 | |
| GITHUB_TOKEN: ${{ secrets.MISE_GH_TOKEN || secrets.GITHUB_TOKEN }} | |
| FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} | |
| permissions: | |
| pull-requests: write | |
| jobs: | |
| build-ubuntu: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| shared-key: build | |
| save-if: false | |
| - run: | | |
| cargo build --all-features | |
| echo "$PWD/target/debug" >> "$GITHUB_PATH" | |
| - run: mise -v | |
| - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: mise-ubuntu-latest | |
| path: target/debug/mise | |
| - uses: ./.github/actions/mise-tools | |
| build-windows: | |
| runs-on: windows-latest | |
| timeout-minutes: 60 | |
| env: | |
| MISE_DATA_DIR: ~/.local/share/mise | |
| MISE_CACHE_DIR: ~/.cache/mise | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| shared-key: build | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - shell: pwsh | |
| run: | | |
| cargo build --no-default-features --features rustls-native-roots,vfox/vendored-lua,self_update | |
| cargo build -p mise-shim | |
| Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE\target\debug" | |
| - run: mise -v | |
| - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: mise-windows-latest | |
| path: | | |
| target/debug/mise.exe | |
| target/debug/mise-shim.exe | |
| - uses: ./.github/actions/mise-tools | |
| unit: | |
| strategy: | |
| fail-fast: false | |
| # matrix: { os: [ubuntu-latest, macos-latest] } | |
| matrix: { os: [macos-latest] } | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| ref: ${{ github.head_ref }} | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| shared-key: build | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: Install fd | |
| run: brew install fd | |
| - run: | | |
| cargo build --all-features | |
| echo "$PWD/target/debug" >> "$GITHUB_PATH" | |
| - uses: ./.github/actions/mise-tools | |
| - run: mise x -- cargo test --all-features | |
| - name: Run sandbox e2e tests | |
| run: | | |
| for test in e2e/sandbox/test_sandbox_*; do | |
| echo "Running $test..." | |
| ./e2e/run_test "$test" | |
| done | |
| nightly: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| ref: ${{ github.head_ref }} | |
| - run: rustup default nightly | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| shared-key: nightly | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - run: | | |
| cargo build --all-features | |
| echo "$PWD/target/debug" >> "$GITHUB_PATH" | |
| - uses: ./.github/actions/mise-tools | |
| - run: mise run test | |
| lint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| needs: [build-ubuntu] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| ref: ${{ github.head_ref }} | |
| - uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1 | |
| - uses: taiki-e/install-action@7a562dfa955aa2e4d5b0fd6ebd57ff9715c07b0b # v2.73.0 | |
| with: | |
| tool: cargo-deny,cargo-msrv,cargo-machete | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| shared-key: build | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: mise-ubuntu-latest | |
| path: target/debug | |
| - run: echo "$PWD/target/debug" >> "$GITHUB_PATH" && chmod +x target/debug/mise | |
| - uses: ./.github/actions/mise-tools | |
| - run: mise x -- bun i | |
| - run: rm -rf ~/.cargo/advisory-dbs && cargo deny check | |
| - run: cargo msrv verify | |
| - run: cargo machete --with-metadata | |
| - run: ./scripts/test-standalone.sh | |
| - run: mise run lint | |
| - run: cargo clippy -- -D warnings | |
| - run: cargo clippy --all-features --all-targets -- -D warnings | |
| e2e: | |
| name: e2e-${{matrix.tranche}} | |
| runs-on: ubuntu-latest | |
| needs: [build-ubuntu] | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| tranche: [0, 1, 2, 3, 4, 5, 6, 7] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch token from pool | |
| id: token | |
| uses: ./.github/actions/fetch-token | |
| with: | |
| api-secret: ${{ secrets.MISE_VERSIONS_API_SECRET }} | |
| - name: Set GITHUB_TOKEN from pool | |
| if: steps.token.outputs.token | |
| run: echo "GITHUB_TOKEN=${{ steps.token.outputs.token }}" >> "$GITHUB_ENV" | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: mise-ubuntu-latest | |
| path: target/debug | |
| - run: echo "$PWD/target/debug" >> "$GITHUB_PATH" && chmod +x target/debug/mise | |
| - uses: ./.github/actions/mise-tools | |
| - name: Pull e2e Docker image | |
| run: docker pull ghcr.io/jdx/mise:e2e | |
| - name: Test in Docker | |
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 | |
| env: | |
| MISE_E2E_DOCKER: "1" | |
| TEST_TRANCHE: ${{matrix.tranche}} | |
| TEST_TRANCHE_COUNT: 8 | |
| TEST_ALL: ${{github.head_ref == 'release' && '1' || '0'}} | |
| with: | |
| timeout_minutes: 30 | |
| retry_wait_seconds: 30 | |
| max_attempts: 2 | |
| command: ./e2e/run_all_tests | |
| windows-unit: | |
| runs-on: windows-latest | |
| timeout-minutes: 30 | |
| env: | |
| MISE_DATA_DIR: ~/.local/share/mise | |
| MISE_CACHE_DIR: ~/.cache/mise | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| shared-key: build | |
| save-if: ${{ github.ref == 'refs/heads/main' }} | |
| - name: cargo test | |
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 | |
| with: | |
| timeout_minutes: 30 | |
| retry_wait_seconds: 30 | |
| max_attempts: 2 | |
| command: cargo test | |
| windows-e2e: | |
| runs-on: windows-latest | |
| timeout-minutes: 40 | |
| needs: [build-windows] | |
| env: | |
| MISE_DATA_DIR: ~/.local/share/mise | |
| MISE_CACHE_DIR: ~/.cache/mise | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: mise-windows-latest | |
| path: target/debug | |
| - run: ls target\debug | |
| - run: Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE\target\debug" | |
| - uses: ./.github/actions/mise-tools | |
| - name: e2e | |
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 | |
| with: | |
| timeout_minutes: 30 | |
| retry_wait_seconds: 30 | |
| max_attempts: 2 | |
| command: pwsh e2e-win\run.ps1 | |
| test-ci: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 1 | |
| needs: | |
| - build-ubuntu | |
| - build-windows | |
| - unit | |
| - nightly | |
| - lint | |
| - e2e | |
| - windows-unit | |
| - windows-e2e | |
| if: always() | |
| steps: | |
| - name: Check CI job results | |
| run: | | |
| if [ "${{ needs.build-ubuntu.result }}" != "success" ]; then | |
| echo "build-ubuntu failed or was skipped" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.build-windows.result }}" != "success" ]; then | |
| echo "build-windows failed or was skipped" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.unit.result }}" != "success" ]; then | |
| echo "unit failed or was skipped" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.nightly.result }}" != "success" ]; then | |
| echo "nightly failed or was skipped" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.lint.result }}" != "success" ]; then | |
| echo "lint failed or was skipped" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.e2e.result }}" != "success" ]; then | |
| echo "e2e failed or was skipped" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.windows-unit.result }}" != "success" ]; then | |
| echo "windows-unit failed or was skipped" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.windows-e2e.result }}" != "success" ]; then | |
| echo "windows-e2e failed or was skipped" | |
| exit 1 | |
| fi | |
| echo "All CI jobs completed successfully" |