@@ -48,23 +48,39 @@ jobs:
48
48
run : |
49
49
brew install gnu-tar
50
50
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') }}
51
62
- uses : actions/cache@v3
63
+ if : steps.cache-extractor.outputs.cache-hit != 'true'
52
64
with :
53
65
path : |
54
66
~/.cargo/registry
55
67
~/.cargo/git
56
68
ruby/target
57
69
key : ${{ runner.os }}-ruby-rust-cargo-${{ hashFiles('ruby/rust-toolchain.toml', 'ruby/**/Cargo.lock') }}
58
70
- name : Check formatting
71
+ if : steps.cache-extractor.outputs.cache-hit != 'true'
59
72
run : cargo fmt --all -- --check
60
73
- name : Build
74
+ if : steps.cache-extractor.outputs.cache-hit != 'true'
61
75
run : cargo build --verbose
62
76
- name : Run tests
77
+ if : steps.cache-extractor.outputs.cache-hit != 'true'
63
78
run : cargo test --verbose
64
79
- name : Release build
80
+ if : steps.cache-extractor.outputs.cache-hit != 'true'
65
81
run : cargo build --release
66
82
- name : Generate dbscheme
67
- if : ${{ matrix.os == 'ubuntu-latest' }}
83
+ if : ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true' }}
68
84
run : target/release/ruby-generator --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
69
85
- uses : actions/upload-artifact@v3
70
86
if : ${{ matrix.os == 'ubuntu-latest' }}
0 commit comments