Compare commits

...
7 Commits
5 changed files with 31 additions and 8 deletions
+1 -2
View File
@@ -32,7 +32,6 @@ jobs:
- { os: windows-2019, ruby: truffleruby } - { os: windows-2019, ruby: truffleruby }
- { os: windows-2019, ruby: truffleruby-head } - { os: windows-2019, ruby: truffleruby-head }
- { os: macos-11.0, ruby: truffleruby } - { os: macos-11.0, ruby: truffleruby }
- { os: macos-11.0, ruby: truffleruby-head }
name: ${{ matrix.os }} ${{ matrix.ruby }} name: ${{ matrix.os }} ${{ matrix.ruby }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -104,7 +103,7 @@ jobs:
run: gem install sassc -N run: gem install sassc -N
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: yarn install - run: yarn install
+18 -2
View File
@@ -16,7 +16,7 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
| ----------- | -------- | | ----------- | -------- |
| Ruby | 2.1.9, 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.10, 2.5.0 - 2.5.8, 2.6.0 - 2.6.6, 2.7.2, head, debug, mingw, mswin | | Ruby | 2.1.9, 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.10, 2.5.0 - 2.5.8, 2.6.0 - 2.6.6, 2.7.2, head, debug, mingw, mswin |
| JRuby | 9.1.17.0, 9.2.9.0 - 9.2.13.0, head | | JRuby | 9.1.17.0, 9.2.9.0 - 9.2.13.0, head |
| TruffleRuby | 19.3.0 - 20.2.0, head | | TruffleRuby | 19.3.0 - 20.3.0, head |
`ruby-debug` is the same as `ruby-head` but with assertions enabled (`-DRUBY_DEBUG=1`). `ruby-debug` is the same as `ruby-head` but with assertions enabled (`-DRUBY_DEBUG=1`).
On Windows, `mingw` and `mswin` are `ruby-head` builds using the MSYS2/MinGW and the MSVC toolchains respectively. On Windows, `mingw` and `mswin` are `ruby-head` builds using the MSYS2/MinGW and the MSVC toolchains respectively.
@@ -85,7 +85,6 @@ jobs:
os: [ubuntu, macos] os: [ubuntu, macos]
ruby: [2.5, 2.6, 2.7, head, debug, jruby, jruby-head, truffleruby, truffleruby-head] ruby: [2.5, 2.6, 2.7, head, debug, jruby, jruby-head, truffleruby, truffleruby-head]
runs-on: ${{ matrix.os }}-latest runs-on: ${{ matrix.os }}-latest
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@v1
@@ -137,6 +136,23 @@ This caching speeds up installing gems significantly and avoids too many request
It needs a `Gemfile` (or `$BUNDLE_GEMFILE` or `gems.rb`) under the [`working-directory`](#working-directory). It needs a `Gemfile` (or `$BUNDLE_GEMFILE` or `gems.rb`) under the [`working-directory`](#working-directory).
If there is a `Gemfile.lock` (or `$BUNDLE_GEMFILE.lock` or `gems.locked`), `bundle config --local deployment true` is used. If there is a `Gemfile.lock` (or `$BUNDLE_GEMFILE.lock` or `gems.locked`), `bundle config --local deployment true` is used.
To use a `Gemfile` which is not at the root or has a different name, set `BUNDLE_GEMFILE` in the `env` at the job level, so it is set for all steps:
```yaml
jobs:
test:
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: subdir/mygemfile
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- run: bundle exec rake
```
Of course you can also use a matrix of gemfiles if you need to test multiple gemfiles.
To perform caching, this action will use `bundle config --local path vendor/bundle`. To perform caching, this action will use `bundle config --local path vendor/bundle`.
Therefore, the Bundler `path` should not be changed in your workflow for the cache to work (no `bundle config path`). Therefore, the Bundler `path` should not be changed in your workflow for the cache to work (no `bundle config path`).
Generated Vendored
+6 -2
View File
@@ -44550,7 +44550,7 @@ function getVersions(platform) {
], ],
"truffleruby": [ "truffleruby": [
"19.3.0", "19.3.1", "19.3.0", "19.3.1",
"20.0.0", "20.1.0", "20.2.0", "20.0.0", "20.1.0", "20.2.0", "20.3.0",
"head" "head"
] ]
} }
@@ -51421,7 +51421,7 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
const paths = [path] const paths = [path]
const baseKey = await computeBaseKey(platform, engine, version, lockFile) const baseKey = await computeBaseKey(platform, engine, version, lockFile)
const key = `${baseKey}-${await common.hashFile(lockFile)}` const key = `${baseKey}-${await common.hashFile(lockFile)}`
// If only Gemfile.lock changes we can reuse part of the cache (but it will keep old gem versions in the cache) // If only Gemfile.lock changes we can reuse part of the cache, and clean old gem versions below
const restoreKeys = [`${baseKey}-`] const restoreKeys = [`${baseKey}-`]
console.log(`Cache key: ${key}`) console.log(`Cache key: ${key}`)
@@ -51446,6 +51446,10 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
// @actions/cache only allows to save for non-existing keys // @actions/cache only allows to save for non-existing keys
if (cachedKey !== key) { if (cachedKey !== key) {
if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems
await exec.exec('bundle', ['clean'])
}
// Error handling from https://github.com/actions/cache/blob/master/src/save.ts // Error handling from https://github.com/actions/cache/blob/master/src/save.ts
console.log('Saving cache') console.log('Saving cache')
try { try {
+5 -1
View File
@@ -249,7 +249,7 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
const paths = [path] const paths = [path]
const baseKey = await computeBaseKey(platform, engine, version, lockFile) const baseKey = await computeBaseKey(platform, engine, version, lockFile)
const key = `${baseKey}-${await common.hashFile(lockFile)}` const key = `${baseKey}-${await common.hashFile(lockFile)}`
// If only Gemfile.lock changes we can reuse part of the cache (but it will keep old gem versions in the cache) // If only Gemfile.lock changes we can reuse part of the cache, and clean old gem versions below
const restoreKeys = [`${baseKey}-`] const restoreKeys = [`${baseKey}-`]
console.log(`Cache key: ${key}`) console.log(`Cache key: ${key}`)
@@ -274,6 +274,10 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
// @actions/cache only allows to save for non-existing keys // @actions/cache only allows to save for non-existing keys
if (cachedKey !== key) { if (cachedKey !== key) {
if (cachedKey) { // existing cache but Gemfile.lock differs, clean old gems
await exec.exec('bundle', ['clean'])
}
// Error handling from https://github.com/actions/cache/blob/master/src/save.ts // Error handling from https://github.com/actions/cache/blob/master/src/save.ts
console.log('Saving cache') console.log('Saving cache')
try { try {
+1 -1
View File
@@ -18,7 +18,7 @@ export function getVersions(platform) {
], ],
"truffleruby": [ "truffleruby": [
"19.3.0", "19.3.1", "19.3.0", "19.3.1",
"20.0.0", "20.1.0", "20.2.0", "20.0.0", "20.1.0", "20.2.0", "20.3.0",
"head" "head"
] ]
} }