Skip to content

Commit 30716fe

Browse files
committed
🌅
1 parent 7b5d3e4 commit 30716fe

File tree

1,778 files changed

+117364
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,778 files changed

+117364
-0
lines changed

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "cargo"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"

.github/workflows/cli.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 🚦 CLI Tests
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
actions: write
11+
contents: read
12+
id-token: write
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
17+
jobs:
18+
test:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os:
23+
[ubuntu-latest-16-cores, macos-latest-xlarge, windows-latest-16-cores]
24+
name: 🚦 Test
25+
runs-on: ${{ matrix.os }}
26+
27+
steps:
28+
- name: 🛑 Cancel Previous Runs
29+
uses: styfle/cancel-workflow-action@0.12.1
30+
31+
- run: git config --global core.autocrlf false
32+
33+
- name: ⬇️ Checkout qlty
34+
uses: actions/checkout@v4
35+
36+
- name: 🦀 Install Rust toolchain
37+
uses: actions-rs/toolchain@v1
38+
with:
39+
toolchain: stable
40+
41+
- name: Install cargo-llvm-cov
42+
uses: taiki-e/install-action@cargo-llvm-cov
43+
44+
- name: Setup PHP with PECL extension
45+
uses: shivammathur/setup-php@v2
46+
if: matrix.os == 'macos-latest-xlarge'
47+
48+
- name: 🫙 Cache Rust
49+
uses: Swatinem/rust-cache@v2
50+
51+
- name: 🚦 Run Test
52+
run: cargo llvm-cov --lcov --output-path target/lcov.info -- --include-ignored
53+
54+
- uses: qltysh/qlty-action/coverage@main
55+
with:
56+
coverage-token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
57+
files: target/lcov.info
58+
tag: cli
59+
skip-errors: true

.github/workflows/cli_integration.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: "🦀 Integration Tests"
2+
on:
3+
workflow_dispatch:
4+
push:
5+
paths:
6+
- "**/ruby.rs"
7+
- "**/ruby/**/*.rs"
8+
- .github/workflows/cli_integration.yml
9+
branches:
10+
- main
11+
pull_request:
12+
paths:
13+
- "**/ruby.rs"
14+
- "**/ruby/**/*.rs"
15+
- .github/workflows/cli_integration.yml
16+
17+
permissions:
18+
actions: write
19+
contents: read
20+
id-token: write
21+
22+
env:
23+
CARGO_TERM_COLOR: always
24+
25+
jobs:
26+
build:
27+
name: 🏗️ Build Release CLI
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: ⬇️ Checkout cloud
31+
uses: actions/checkout@v4
32+
33+
- name: 🦀 Install Rust toolchain
34+
uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: stable
37+
38+
- name: 🫙 Cache Rust
39+
uses: Swatinem/rust-cache@v2
40+
41+
- name: 🏗️ Build Release CLI
42+
run: cargo build --release
43+
44+
- name: 📦 Archive CLI
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: qlty
48+
path: target/release/qlty
49+
50+
test_ruby_binary_install:
51+
name: "🧪 Test: Ruby Binary Install"
52+
runs-on: ubuntu-latest
53+
needs: build
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
container: [
58+
"ubuntu:24.04",
59+
"redhat/ubi9",
60+
"debian:trixie-slim",
61+
"debian:bookworm-slim",
62+
# unsupported:
63+
# "ubuntu:20.04",
64+
# "redhat/ubi8",
65+
]
66+
include:
67+
- container: ubuntu:24.04
68+
package_install: apt-get update && apt-get install -y git curl libyaml-dev libgmp-dev build-essential
69+
- container: debian:trixie-slim
70+
package_install: apt-get update && apt-get install -y git curl libyaml-dev libgmp-dev build-essential
71+
- container: debian:bookworm-slim
72+
package_install: apt-get update && apt-get install -y git curl libyaml-dev libgmp-dev build-essential
73+
- container: redhat/ubi9
74+
package_install: yum install -y git gcc make libyaml-devel gmp-devel
75+
# unsupported:
76+
# - container: ubuntu:20.04
77+
# package_install: apt-get update && apt-get install -y git curl libyaml-dev libgmp-dev build-essential
78+
# - container: redhat/ubi8
79+
# package_install: yum install -y git gcc make libyaml-devel gmp-devel
80+
container:
81+
image: ${{ matrix.container }}
82+
env:
83+
QLTY_LOG: debug
84+
QLTY_LOG_STDERR: 1
85+
86+
steps:
87+
- run: ${{ matrix.package_install }}
88+
89+
- name: ⚙️ Setup Repository
90+
run: |
91+
mkdir repo
92+
cd repo
93+
echo 'CONST = 1' > main.rb
94+
git init .
95+
git config --global user.email "user@example.com"
96+
git config --global user.name "Test User"
97+
git add .
98+
git commit -m "Initial commit"
99+
100+
- name: 📦 Download CLI
101+
uses: actions/download-artifact@v4
102+
with:
103+
name: qlty
104+
path: ${{ github.workspace }}/bin
105+
106+
- name: "🚦 Run Test"
107+
run: |
108+
export PATH=$GITHUB_WORKSPACE/bin:$PATH
109+
chmod +x $GITHUB_WORKSPACE/bin/qlty
110+
qlty init -n
111+
qlty plugins enable standardrb
112+
qlty check --all --no-cache --no-progress --filter=standardrb
113+
working-directory: repo

.github/workflows/plugins.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: 🚦 Plugin Tests
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
actions: write
11+
contents: read
12+
id-token: write
13+
14+
env:
15+
CARGO_TERM_COLOR: always
16+
17+
jobs:
18+
test:
19+
if: github.actor != 'dependabot[bot]'
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os:
24+
[macos-latest-xlarge, ubuntu-latest-16-cores, windows-latest-16-cores]
25+
name: Plugins test on ${{ matrix.os }}
26+
runs-on: ${{ matrix.os }}
27+
defaults:
28+
run:
29+
shell: bash
30+
31+
steps:
32+
- name: 🛑 Cancel Previous Runs
33+
uses: styfle/cancel-workflow-action@0.12.1
34+
35+
- name: ⬇️ Checkout repo
36+
uses: actions/checkout@v4
37+
38+
- name: 📦 Use Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
cache: "npm"
42+
cache-dependency-path: plugins/package-lock.json
43+
44+
# Generate Cache key for Linux/macOS
45+
- name: 🔒 Set CACHE_MONTH on Linux/macOS
46+
run: echo "CACHE_MONTH=$(date +'%Y-%m')" >> $GITHUB_ENV
47+
48+
- name: 💾 Cache qlty tools
49+
uses: actions/cache@v3
50+
with:
51+
path: ~/.qlty
52+
key: ${{ runner.os }}-qlty-${{ env.CACHE_MONTH }}
53+
54+
- name: 📦 Setup PHP with PECL extension
55+
uses: shivammathur/setup-php@v2
56+
if: matrix.os == 'macos-latest-xlarge'
57+
58+
- name: 📦 Setup Ruby
59+
uses: ruby/setup-ruby@v1
60+
with:
61+
ruby-version: 3.3.0
62+
if: matrix.os == 'windows-latest-16-cores'
63+
64+
- name: 🦀 Install Rust toolchain
65+
uses: actions-rs/toolchain@v1
66+
with:
67+
toolchain: stable
68+
69+
- name: 🫙 Cache Rust
70+
uses: Swatinem/rust-cache@v2
71+
72+
- name: ⚙️ cargo build
73+
run: cargo build
74+
env:
75+
RUST_BACKTRACE: 1
76+
77+
- name: Move qlty into PATH
78+
run: echo "${{ github.workspace }}/target/debug" >> $GITHUB_PATH
79+
80+
- name: 🔍 Check qlty version
81+
run: qlty --version
82+
83+
# Login to the GitHub Container Registry to reduce trivy rate limiting errors
84+
- name: Log in to registry
85+
# macOS does not support Docker
86+
if: matrix.os != 'macos-latest-xlarge'
87+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
88+
89+
- name: Run plugins tests
90+
working-directory: plugins
91+
run: |
92+
npm ci
93+
npm test

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target/*
2+
!/target/doc
3+
flamegraph.svg
4+
.env

.qlty/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
results
2+
logs
3+
out
4+
sources

.qlty/configs/.flake8

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Autoformatter friendly flake8 config (all formatting rules disabled)
2+
[flake8]
3+
extend-ignore = D1, D2, E1, E2, E3, E501, W1, W2, W3, W5

.qlty/configs/.hadolint.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignored:
2+
- DL3008

0 commit comments

Comments
 (0)