1616 strategy :
1717 matrix :
1818 crate :
19- - vhdl_lang
20- - vhdl_ls
19+ - { name: "vhdl_lang", binary: true }
20+ - { name: "vhdl_ls", binary: true }
21+ - { name: "vhdl_syntax", binary: false }
22+ - { name: "vhdl-dump-ast", binary: false }
2123 target :
2224 - x86_64-unknown-linux-gnu
2325 - x86_64-unknown-linux-musl
@@ -49,11 +51,16 @@ jobs:
4951 uses : dtolnay/rust-toolchain@stable
5052 with :
5153 toolchain : ${{ matrix.rust }}
52- target : x86_64-unknown-linux-musl
54+ target : ${{ matrix.target }}
5355 components : rustfmt, clippy
5456
55- - name : Add Apple Silicon Dependencies
56- run : rustup target add aarch64-apple-darwin
57+ - name : Cache cargo
58+ uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
59+ with :
60+ path : |
61+ ~/.cargo/registry
62+ ~/.cargo/git
63+ key : ${{ runner.os }}-${{ matrix.target }}-${{ matrix.rust }}-${{ matrix.crate.name }}-${{ hashFiles('**/Cargo.lock') }}
5764
5865 - uses : awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 # v1.5.0
5966 if : matrix.os == 'ubuntu-latest'
@@ -62,34 +69,34 @@ jobs:
6269 version : 1.0
6370
6471 - name : Build
65- run : cargo build --manifest-path ${{ matrix.crate }}/Cargo.toml --release --target ${{ matrix.target }}
72+ run : cargo build --manifest-path ${{ matrix.crate.name }}/Cargo.toml --release --target ${{ matrix.target }}
6673
6774 - name : Test
6875 if : matrix.os != 'macos-latest' # There are no free runners for Apple Silicon available at the moment
69- run : cargo test --manifest-path ${{ matrix.crate }}/Cargo.toml --release --target ${{ matrix.target }}
76+ run : cargo test --manifest-path ${{ matrix.crate.name }}/Cargo.toml --release --target ${{ matrix.target }}
7077
7178 - name : rustfmt
72- if : matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
73- run : cargo fmt --package ${{ matrix.crate }} -- --check
79+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu' && matrix. rust == 'stable' }}
80+ run : cargo fmt --manifest-path ${{ matrix.crate.name }}/Cargo.toml -- --check
7481
7582 - name : clippy
76- if : matrix.os == 'ubuntu-latest'
77- run : cargo clippy --package ${{ matrix.crate }} --all-targets --all-features -- -D warnings
83+ if : ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu' && matrix.rust == 'stable' }}
84+ run : cargo clippy --manifest-path ${{ matrix.crate.name }}/Cargo.toml --all-targets --all-features -- -D warnings
7885
7986 - name : Assemble
80- if : matrix.rust == 'stable'
87+ if : ${{ matrix.crate.binary == true && matrix. rust == 'stable' }}
8188 run : |
82- mkdir ${{ matrix.crate }}-${{ matrix.target }}
83- mkdir ${{ matrix.crate }}-${{ matrix.target }}/bin
84- cp -R vhdl_libraries ${{ matrix.crate }}-${{ matrix.target }}
85- cp target/${{ matrix.target }}/release/${{ matrix.crate }}${{ matrix.ext }} ${{ matrix.crate }}-${{ matrix.target }}/bin
89+ mkdir ${{ matrix.crate.name }}-${{ matrix.target }}
90+ mkdir ${{ matrix.crate.name }}-${{ matrix.target }}/bin
91+ cp -R vhdl_libraries ${{ matrix.crate.name }}-${{ matrix.target }}
92+ cp target/${{ matrix.target }}/release/${{ matrix.crate.name }}${{ matrix.ext }} ${{ matrix.crate.name }}-${{ matrix.target }}/bin
8693
8794 - name : Upload
88- if : matrix.rust == 'stable'
95+ if : ${{ matrix.crate.binary == true && matrix. rust == 'stable' }}
8996 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
9097 with :
91- name : ${{ matrix.crate }}-${{ matrix.target }}
92- path : ${{ matrix.crate }}-${{ matrix.target }}
98+ name : ${{ matrix.crate.name }}-${{ matrix.target }}
99+ path : ${{ matrix.crate.name }}-${{ matrix.target }}
93100
94101 release :
95102 name : Release
@@ -126,7 +133,7 @@ jobs:
126133 version_string=$(~/temp/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --version)
127134 if [ "$version_string" != "vhdl_ls $v" ]
128135 then
129- echo "Version string mismatch (\"$version_string\" != \"vhdl_lang $v\""
136+ echo "Version string mismatch (\"$version_string\" != \"vhdl_ls $v\""
130137 exit 1
131138 else
132139 echo "Version string matched"
0 commit comments