Skip to content

Commit 53049e5

Browse files
authored
Merge pull request #12 from faltawy/codex/analyze-and-rewrite-code-with-tests
Add filesystem condition tests and serial theme tests
2 parents 5d1bdaa + 32b3f56 commit 53049e5

File tree

14 files changed

+386
-106
lines changed

14 files changed

+386
-106
lines changed

.github/workflows/pr-tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: PR Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
build-and-test:
9+
name: Build and Test (${{ matrix.target }})
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
target: x86_64-unknown-linux-gnu
16+
- os: windows-2019
17+
target: x86_64-pc-windows-msvc
18+
- os: macos-latest
19+
target: x86_64-apple-darwin
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Install Rust
26+
uses: dtolnay/rust-toolchain@master
27+
with:
28+
toolchain: stable
29+
targets: ${{ matrix.target }}
30+
31+
- name: Cache Rust dependencies
32+
uses: Swatinem/rust-cache@v2
33+
with:
34+
key: ${{ matrix.target }}-${{ matrix.os }}
35+
36+
- name: Install cross (Linux only)
37+
if: matrix.os == 'ubuntu-latest'
38+
run: cargo install cross --locked
39+
40+
- name: Setup MSVC Environment (Windows only)
41+
if: matrix.os == 'windows-2019'
42+
uses: microsoft/setup-msbuild@v1.3
43+
44+
- name: Build
45+
run: cargo build --target ${{ matrix.target }} --release
46+
47+
- name: Run tests
48+
run: cargo test --target ${{ matrix.target }} --release

.github/workflows/publish.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,17 @@ jobs:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5353

5454
build-and-test:
55-
name: Build and Test (${{ matrix.target.rust }}, ${{ matrix.os }})
55+
name: Build and Test (${{ matrix.target }})
5656
runs-on: ${{ matrix.os }}
5757
strategy:
5858
matrix:
59-
os: [ubuntu-latest, windows-2019]
60-
target:
61-
- { rust: x86_64-unknown-linux-gnu, os: ubuntu-latest }
62-
- { rust: x86_64-pc-windows-msvc, os: windows-2019 }
63-
exclude:
59+
include:
6460
- os: ubuntu-latest
65-
target: { rust: x86_64-pc-windows-msvc }
61+
target: x86_64-unknown-linux-gnu
6662
- os: windows-2019
67-
target: { rust: x86_64-unknown-linux-gnu }
63+
target: x86_64-pc-windows-msvc
64+
- os: macos-latest
65+
target: x86_64-apple-darwin
6866

6967
steps:
7068
- name: Checkout code
@@ -74,12 +72,12 @@ jobs:
7472
uses: dtolnay/rust-toolchain@master
7573
with:
7674
toolchain: ${{ env.RUST_VERSION }}
77-
targets: ${{ matrix.target.rust }}
75+
targets: ${{ matrix.target }}
7876

7977
- name: Cache Rust dependencies
8078
uses: Swatinem/rust-cache@v2
8179
with:
82-
key: ${{ matrix.target.rust }}-${{ matrix.os }}
80+
key: ${{ matrix.target }}-${{ matrix.os }}
8381

8482
- name: Install cross (Linux only)
8583
if: matrix.os == 'ubuntu-latest'
@@ -90,28 +88,33 @@ jobs:
9088
uses: microsoft/setup-msbuild@v1.3
9189

9290
- name: Build
93-
run: cargo build --target ${{ matrix.target.rust }} --release
91+
run: cargo build --target ${{ matrix.target }} --release
9492

9593
- name: Run tests
96-
run: cargo test --target ${{ matrix.target.rust }} --release
94+
run: cargo test --target ${{ matrix.target }} --release
9795

9896
- name: List artifacts (Debug)
9997
run: |
100-
ls -la target/${{ matrix.target.rust }}/release/
98+
ls -la target/${{ matrix.target }}/release/
10199
if: matrix.os == 'ubuntu-latest'
102-
100+
103101
- name: List artifacts (Debug - Windows)
104102
run: |
105-
dir target\${{ matrix.target.rust }}\release\
103+
dir target\${{ matrix.target }}\release\
106104
if: matrix.os == 'windows-2019'
107105

106+
- name: List artifacts (Debug - macOS)
107+
run: |
108+
ls -la target/${{ matrix.target }}/release/
109+
if: matrix.os == 'macos-latest'
110+
108111
- name: Upload artifacts
109112
uses: actions/upload-artifact@v4
110113
with:
111-
name: ${{ matrix.target.rust }}-binaries
114+
name: ${{ matrix.target }}-binaries
112115
path: |
113-
target/${{ matrix.target.rust }}/release/lsql
114-
target/${{ matrix.target.rust }}/release/lsql.exe
116+
target/${{ matrix.target }}/release/lsql
117+
target/${{ matrix.target }}/release/lsql.exe
115118
if-no-files-found: warn
116119

117120
release:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
.idea/
3-
Cargo.lock
3+
!.idea/overview.md
4+
Cargo.lock

.idea/overview.md

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.lock

Lines changed: 148 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ miette = { version = "7.5.0", features = ["fancy"] }
4141
regex = "1.10.3"
4242
tempfile = "3.10.1"
4343
crossterm = "0.28.1"
44+
45+
[dev-dependencies]
46+
serial_test = "2.0"
4447
[[bin]]
4548
name = "lsql"
4649
path = "src/main.rs"

0 commit comments

Comments
 (0)