@@ -16,10 +16,10 @@ jobs:
1616 strategy :
1717 matrix :
1818 crate :
19- - vhdl_lang
20- - vhdl_ls
21- - vhdl_syntax
22- - vhdl-dump-ast
19+ - { name: " vhdl_lang", path: "crates/vhdl_lang", binary: true }
20+ - { name: " vhdl_ls", path: "crates/vhdl_ls", binary: true }
21+ - { name: " vhdl_syntax", path: "crates/vhdl_syntax", binary: false }
22+ - { name: " vhdl-dump-ast", path: "crates/vhdl-dump-ast", binary: false }
2323 target :
2424 - x86_64-unknown-linux-gnu
2525 - x86_64-unknown-linux-musl
@@ -51,11 +51,15 @@ jobs:
5151 uses : dtolnay/rust-toolchain@stable
5252 with :
5353 toolchain : ${{ matrix.rust }}
54- target : x86_64-unknown-linux-musl
54+ target : ${{ matrix.target }}
5555 components : rustfmt, clippy
56-
57- - name : Add Apple Silicon Dependencies
58- run : rustup target add aarch64-apple-darwin
56+ - name : Cache cargo
57+ uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
58+ with :
59+ path : |
60+ ~/.cargo/registry
61+ ~/.cargo/git
62+ key : ${{ runner.os }}-${{ matrix.target }}-${{ matrix.rust }}-${{ matrix.crate.name }}-${{ hashFiles('**/Cargo.lock') }}
5963
6064 - uses : awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 # v1.5.0
6165 if : matrix.os == 'ubuntu-latest'
@@ -64,34 +68,34 @@ jobs:
6468 version : 1.0
6569
6670 - name : Build
67- run : cargo build --manifest-path ${{ matrix.crate }}/Cargo.toml --release --target ${{ matrix.target }}
71+ run : cargo build --manifest-path ${{ matrix.crate.path }}/Cargo.toml --release --target ${{ matrix.target }}
6872
6973 - name : Test
7074 if : matrix.os != 'macos-latest' # There are no free runners for Apple Silicon available at the moment
71- run : cargo test --manifest-path ${{ matrix.crate }}/Cargo.toml --release --target ${{ matrix.target }}
75+ run : cargo test --manifest-path ${{ matrix.crate.path }}/Cargo.toml --release --target ${{ matrix.target }}
7276
7377 - name : rustfmt
7478 if : matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
75- run : cargo fmt --package ${{ matrix.crate }} -- --check
79+ run : cargo fmt --manifest-path ${{ matrix.crate.path }}/Cargo.toml -- --check
7680
7781 - name : clippy
78- if : matrix.os == 'ubuntu-latest'
79- run : cargo clippy --package ${{ matrix.crate }} --all-targets --all-features -- -D warnings
82+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu' }}
83+ run : cargo clippy --manifest-path ${{ matrix.crate.path }}/Cargo.toml --all-targets --all-features -- -D warnings
8084
8185 - name : Assemble
82- if : matrix.rust == 'stable'
86+ if : ${{ matrix.crate.binary == true && matrix. rust == 'stable' }}
8387 run : |
84- mkdir ${{ matrix.crate }}-${{ matrix.target }}
85- mkdir ${{ matrix.crate }}-${{ matrix.target }}/bin
86- cp -R vhdl_libraries ${{ matrix.crate }}-${{ matrix.target }}
87- cp target/${{ matrix.target }}/release/${{ matrix.crate }}${{ matrix.ext }} ${{ matrix.crate }}-${{ matrix.target }}/bin
88+ mkdir ${{ matrix.crate.name }}-${{ matrix.target }}
89+ mkdir ${{ matrix.crate.name }}-${{ matrix.target }}/bin
90+ cp -R vhdl_libraries ${{ matrix.crate.name }}-${{ matrix.target }}
91+ cp target/${{ matrix.target }}/release/${{ matrix.crate.name }}${{ matrix.ext }} ${{ matrix.crate.name }}-${{ matrix.target }}/bin
8892
8993 - name : Upload
90- if : matrix.rust == 'stable'
94+ if : ${{ matrix.crate.binary == true && matrix. rust == 'stable' }}
9195 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
9296 with :
93- name : ${{ matrix.crate }}-${{ matrix.target }}
94- path : ${{ matrix.crate }}-${{ matrix.target }}
97+ name : ${{ matrix.crate.name }}-${{ matrix.target }}
98+ path : ${{ matrix.crate.name }}-${{ matrix.target }}
9599
96100 release :
97101 name : Release
@@ -128,7 +132,7 @@ jobs:
128132 version_string=$(~/temp/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --version)
129133 if [ "$version_string" != "vhdl_ls $v" ]
130134 then
131- echo "Version string mismatch (\"$version_string\" != \"vhdl_lang $v\""
135+ echo "Version string mismatch (\"$version_string\" != \"vhdl_ls $v\""
132136 exit 1
133137 else
134138 echo "Version string matched"
0 commit comments