@@ -48,23 +48,39 @@ jobs:
4848 run : |
4949 brew install gnu-tar
5050 echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
51+ - name : Cache entire extractor
52+ uses : actions/cache@v3
53+ id : cache-extractor
54+ with :
55+ path : |
56+ ruby/target/release/ruby-autobuilder
57+ ruby/target/release/ruby-autobuilder.exe
58+ ruby/target/release/ruby-extractor
59+ ruby/target/release/ruby-extractor.exe
60+ ruby/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
61+ key : ${{ runner.os }}-ruby-extractor-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/**/Cargo.lock') }}--${{ hashFiles('ruby/**/*.rs') }}
5162 - uses : actions/cache@v3
63+ if : steps.cache-extractor.outputs.cache-hit != 'true'
5264 with :
5365 path : |
5466 ~/.cargo/registry
5567 ~/.cargo/git
5668 ruby/target
5769 key : ${{ runner.os }}-ruby-rust-cargo-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/**/Cargo.lock') }}
5870 - name : Check formatting
71+ if : steps.cache-extractor.outputs.cache-hit != 'true'
5972 run : cargo fmt --all -- --check
6073 - name : Build
74+ if : steps.cache-extractor.outputs.cache-hit != 'true'
6175 run : cargo build --verbose
6276 - name : Run tests
77+ if : steps.cache-extractor.outputs.cache-hit != 'true'
6378 run : cargo test --verbose
6479 - name : Release build
80+ if : steps.cache-extractor.outputs.cache-hit != 'true'
6581 run : cargo build --release
6682 - name : Generate dbscheme
67- if : ${{ matrix.os == 'ubuntu-latest' }}
83+ if : ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true' }}
6884 run : target/release/ruby-generator --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
6985 - uses : actions/upload-artifact@v3
7086 if : ${{ matrix.os == 'ubuntu-latest' }}
0 commit comments