Skip to content

ci: run ci on macos and windows #127

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

Closed
wants to merge 13 commits into from
Closed
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
42 changes: 42 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Set default behavior to automatically normalize line endings.
* text=auto

# Ensure these files always have LF line endings on checkout
*.ts text eol=lf
*.js text eol=lf
*.mjs text eol=lf
*.cjs text eol=lf
*.jsx text eol=lf
*.tsx text eol=lf
*.json text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.toml text eol=lf
*.go text eol=lf

# Shell scripts should always have LF
*.sh text eol=lf

# Windows batch files should have CRLF
*.bat text eol=crlf
*.cmd text eol=crlf

# Binary files should not be touched
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.svg binary
*.woff binary
*.woff2 binary
*.ttf binary
*.eot binary
*.zip binary
*.tar.gz binary
*.tgz binary
*.exe binary
*.dll binary
*.so binary
*.dylib binary
19 changes: 17 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ env:
jobs:
test-go:
name: Test Go
runs-on: rspack-ubuntu-22.04-large
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
[
rspack-ubuntu-22.04-large,
rspack-darwin-14-medium,
rspack-windows-2022-large,
]
go-version: ['1.24.1']
steps:
- name: Checkout code
Expand All @@ -39,23 +45,32 @@ jobs:
go-version: ${{ matrix.go-version }}
cache-name: test-go
- name: golangci-lint
if: ${{ runner.os == 'Linux' && runner.environment == 'self-hosted' }}
uses: golangci/golangci-lint-action@v8
with:
version: v2.3.0
args: --timeout=5m ./cmd/... ./internal/...
- name: go vet
if: ${{ runner.os == 'Linux' && runner.environment == 'self-hosted' }}
run: npm run lint:go
- name: go fmt
if: ${{ runner.os == 'Linux' && runner.environment == 'self-hosted' }}
run: npm run format:go
- name: Unit Test
run: |
go test -parallel 4 ./internal/...

test-node:
name: Test npm packages
runs-on: rspack-ubuntu-22.04-large
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
[
rspack-ubuntu-22.04-large,
rspack-darwin-14-medium,
rspack-windows-2022-large,
]
go-version: ['1.24.1']
steps:
- name: Checkout code
Expand Down
12 changes: 8 additions & 4 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ func getAllTypeScriptEslintPluginRules() []rule.Rule {
return rules
}

func pathMatch(pattern, name string) (bool, error) {
return doublestar.PathMatch(filepath.ToSlash(pattern), filepath.ToSlash(name))
}

// isFileIgnored checks if a file should be ignored based on ignore patterns
func isFileIgnored(filePath string, ignorePatterns []string) bool {
// Get current working directory for relative path resolution
Expand All @@ -345,21 +349,21 @@ func isFileIgnored(filePath string, ignorePatterns []string) bool {

for _, pattern := range ignorePatterns {
// Try matching against normalized path
if matched, err := doublestar.PathMatch(pattern, normalizedPath); err == nil && matched {
if matched, err := pathMatch(pattern, normalizedPath); err == nil && matched {
return true
}

// Also try matching against original path for absolute patterns
if normalizedPath != filePath {
if matched, err := doublestar.PathMatch(pattern, filePath); err == nil && matched {
if matched, err := pathMatch(pattern, filePath); err == nil && matched {
return true
}
}

// Try Unix-style path for cross-platform compatibility
unixPath := strings.ReplaceAll(normalizedPath, "\\", "/")
if unixPath != normalizedPath {
if matched, err := doublestar.PathMatch(pattern, unixPath); err == nil && matched {
if matched, err := pathMatch(pattern, unixPath); err == nil && matched {
return true
}
}
Expand Down Expand Up @@ -387,7 +391,7 @@ func normalizePath(filePath, cwd string) string {
// isFileIgnoredSimple provides fallback matching when cwd is unavailable
func isFileIgnoredSimple(filePath string, ignorePatterns []string) bool {
for _, pattern := range ignorePatterns {
if matched, err := doublestar.PathMatch(pattern, filePath); err == nil && matched {
if matched, err := pathMatch(pattern, filePath); err == nil && matched {
return true
}
}
Expand Down
157 changes: 0 additions & 157 deletions internal/config/cwd_test.go

This file was deleted.

3 changes: 3 additions & 0 deletions npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@rslint/darwin-arm64",
"version": "0.1.7",
"license": "MIT",
"exports": {
"./bin": "./rslint"
},
"description": "binary for rslint",
"homepage": "https://rslint.rs",
"bugs": "https://github.com/web-infra-dev/rslint/issues",
Expand Down
3 changes: 3 additions & 0 deletions npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@rslint/darwin-x64",
"version": "0.1.7",
"license": "MIT",
"exports": {
"./bin": "./rslint"
},
"description": "binary for rslint",
"bugs": "https://github.com/web-infra-dev/rslint/issues",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions npm/linux-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@rslint/linux-arm64",
"version": "0.1.7",
"license": "MIT",
"exports": {
"./bin": "./rslint"
},
"description": "binary for rslint",
"bugs": "https://github.com/web-infra-dev/rslint/issues",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions npm/linux-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@rslint/linux-x64",
"version": "0.1.7",
"license": "MIT",
"exports": {
"./bin": "./rslint"
},
"description": "binary for rslint",
"bugs": "https://github.com/web-infra-dev/rslint/issues",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions npm/win32-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@rslint/win32-arm64",
"version": "0.1.7",
"license": "MIT",
"exports": {
"./bin": "./rslint.exe"
},
"description": "binary for rslint",
"bugs": "https://github.com/web-infra-dev/rslint/issues",
"repository": {
Expand Down
3 changes: 3 additions & 0 deletions npm/win32-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@rslint/win32-x64",
"version": "0.1.7",
"license": "MIT",
"exports": {
"./bin": "./rslint.exe"
},
"description": "binary for rslint",
"bugs": "https://github.com/web-infra-dev/rslint/issues",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"license": "MIT",
"scripts": {
"build": "pnpm -r build",
"build:npm": "zx scripts/build-npm.mjs",
"check-spell": "pnpx cspell",
"build:npm:all": "zx scripts/build-npm.mjs all",
"build:npm:current": "zx scripts/build-npm.mjs current",
"version": "zx scripts/version.mjs",
"release": "pnpm publish -r --no-git-checks",
"publish:vsce": "zx scripts/publish-marketplace.mjs",
Expand Down
2 changes: 0 additions & 2 deletions packages/rslint/.gitignore

This file was deleted.

Loading
Loading