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 mswin warning #29

Merged
merged 9 commits into from
Feb 17, 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
13 changes: 9 additions & 4 deletions .github/workflows/test-setup-ruby-and-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ env:
jobs:
test:
name: ${{ matrix.os }} ${{ matrix.repo.slug }} (ruby=${{ matrix.ruby }} cache=${{ matrix.cargo-cache }})
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
experimental: [false]
repo:
- name: "oxidize-rb/oxi-test"
slug: oxi-test
Expand All @@ -23,23 +25,25 @@ jobs:
- name: "matsadler/magnus"
slug: magnus
ref: main
run: cargo test
run: cargo test -- --nocapture
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
rust: ["stable"]
ruby: ["3.0", "3.1", "3.2", "3.3"]
cargo-cache: ["true"]
include:
- os: "ubuntu-latest"
ruby: "3.1"
ruby: "3.3"
rust: "stable"
experimental: false
cargo-cache: "sccache"
repo:
name: "oxidize-rb/oxi-test"
slug: oxi-test
ref: main
run: bundle exec rake
run: bundle exec rake || echo "::warning::bundle exec rake failed on mswin"
- os: "windows-latest"
ruby: "mswin"
experimental: true
rust: "stable"
cargo-cache: "true"
repo:
Expand All @@ -50,13 +54,14 @@ jobs:
- os: "windows-latest"
slug: magnus
ruby: "mswin"
experimental: true
rust: "stable"
cargo-cache: "true"
repo:
name: "matsadler/magnus"
slug: magnus
ref: main
run: cargo test
run: cargo test -- --nocapture || echo "::warning::cargo test failed on mswin"

runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion cross-gem/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
echo "RB_SYS_DOCK_CACHE_DIR=$rb_sys_dock_cache_dir" >> $GITHUB_ENV

- name: Setup caching
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ env.RB_SYS_DOCK_CACHE_DIR }}
Expand Down
31 changes: 29 additions & 2 deletions setup-ruby-and-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,33 @@ outputs:
runs:
using: "composite"
steps:
- name: Pre-check
if: inputs.ruby-version == 'mswin'
shell: pwsh
run: |
# : Check for mswin in workflow files
try {
$msg = "mswin builds use ruby-master, and which is unstable and may break your build at any time (see https://github.com/MSP-Greg/ruby-loco/issues/12)"
$workflowFiles = Get-ChildItem -Path ".github/workflows/" -Filter *.yml

if ($matches.Count -eq 0) {
Write-Output "::notice::$msg"
}

foreach ($file in $workflowFiles) {
Write-Output "Checking $file"
$matches = Select-String -Path $file.FullName -Pattern "mswin"
foreach ($match in $matches) {
$lineNumber = $match.LineNumber
$filePath = $file.FullName
$warningMessage = "::warning file=$filePath,line=$lineNumber::$msg"
Write-Output $warningMessage
}
}
} catch {
Write-Output "::warning::Failed to check for mswin in workflow files ($_)"
}

- uses: "ruby/setup-ruby-pkgs@v1"
if: inputs.ruby-version != 'none'
with:
Expand Down Expand Up @@ -174,7 +201,7 @@ runs:
install-path: ${{ github.action_path }}/bin

- name: Cargo registry cache
uses: actions/cache@v3
uses: actions/cache@v4
if: steps.set-outputs.outputs.cargo-cache != 'false'
with:
key: ${{ steps.set-outputs.outputs.cargo-registry-cache-key }}
Expand All @@ -186,7 +213,7 @@ runs:
~/.cargo/git/db/

- name: Setup base cargo cache
uses: actions/cache@v3
uses: actions/cache@v4
if: steps.set-outputs.outputs.cargo-cache == 'tarball'
with:
key: ${{ steps.set-outputs.outputs.base-cache-key-level-3 }}
Expand Down
Loading