Skip to content

Commit 7112e91

Browse files
authored
Add an option to install nightly build (#16)
1 parent 69a66d3 commit 7112e91

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

.github/workflows/test.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,22 @@ jobs:
1616
- '2.6'
1717
- '2.7'
1818
- '2.8'
19+
- '2.9'
20+
nightly: [false]
1921
include:
20-
- {runs-on: ubuntu-18.04, tarantool: '1.10'}
21-
- {runs-on: ubuntu-16.04, tarantool: '1.10'}
22+
- {runs-on: ubuntu-18.04, tarantool: '1.10', nightly: true}
23+
- {runs-on: ubuntu-16.04, tarantool: '1.10', nightly: true}
2224
runs-on: ${{ matrix.runs-on }}
2325
env:
24-
TARANTOOL_CACHE_KEY_SUFFIX: -${{ github.run_id }}
26+
TARANTOOL_CACHE_KEY_SUFFIX: -A-${{ github.run_id }}
2527
steps:
2628
- uses: actions/checkout@v2
2729

2830
- id: get-latest
2931
run: |
3032
node <<'SCRIPT'
3133
process.env["INPUT_TARANTOOL-VERSION"] = "${{ matrix.tarantool }}"
34+
process.env["INPUT_NIGHTLY-BUILD"] = "${{ matrix.nightly }}"
3235
require("./dist/main").latest_version().then(v => {
3336
console.log(v)
3437
console.log(`::set-output name=version::${v}`)
@@ -39,6 +42,7 @@ jobs:
3942
uses: ./
4043
with:
4144
tarantool-version: ${{ matrix.tarantool }}
45+
nightly-build: ${{ matrix.nightly }}
4246

4347
- name: Check precise version
4448
run: |
@@ -52,6 +56,15 @@ jobs:
5256
uses: ./
5357
with:
5458
tarantool-version: ${{ matrix.tarantool }}
59+
nightly-build: ${{ matrix.nightly }}
60+
61+
- name: Verify install from cache
62+
run: |
63+
# Fail if tarantool is installed from apt-get
64+
if dpkg -s tarantool; then
65+
echo "Tarantool wasn't restored from cache"
66+
exit 1
67+
fi
5568
5669
- name: Check branch version
5770
run: |
@@ -70,7 +83,7 @@ jobs:
7083
runs-on: [ubuntu-20.04, ubuntu-20.04, ubuntu-20.04]
7184
runs-on: ${{ matrix.runs-on }}
7285
env:
73-
TARANTOOL_CACHE_KEY_SUFFIX: -${{ github.run_id }}
86+
TARANTOOL_CACHE_KEY_SUFFIX: -B-${{ github.run_id }}
7487
steps:
7588
- uses: actions/checkout@v2
7689
- name: Setup Tarantool

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ steps:
2424
- run: .rocks/bin/luatest -v
2525
```
2626
27+
### Install a nightly build
28+
29+
```yaml
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: tarantool/setup-tarantool@v1
33+
with:
34+
tarantool-version: '2.6'
35+
nightly-build: true
36+
```
37+
2738
# License
2839
2940
The scripts and documentation in this project are released under the [MIT License](LICENSE).

action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ branding:
66
inputs:
77
tarantool-version:
88
description: Tarantool version
9+
nightly-build:
10+
description: Whether to install a nightly build
11+
required: false
12+
default: false
913
cache-key:
1014
description: Deprecated. Custom key used for APT packages caching
1115
required: false

dist/main/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3400,7 +3400,9 @@ const exec = __importStar(__webpack_require__(986));
34003400
const io = __importStar(__webpack_require__(1));
34013401
const path = __importStar(__webpack_require__(622));
34023402
const fs = __importStar(__webpack_require__(747));
3403-
const baseUrl = 'https://download.tarantool.org/tarantool/release/' +
3403+
const nightlyBuild = (core.getInput('nightly-build') || 'false').toUpperCase() === 'TRUE';
3404+
const baseUrl = 'https://download.tarantool.org/tarantool/' +
3405+
(nightlyBuild ? '' : 'release/') +
34043406
core.getInput('tarantool-version', { required: true });
34053407
async function capture(cmd, options) {
34063408
let output = '';

src/main.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import * as io from '@actions/io'
77
import * as path from 'path'
88
import * as fs from 'fs'
99

10+
const nightlyBuild =
11+
(core.getInput('nightly-build') || 'false').toUpperCase() === 'TRUE'
1012
const baseUrl =
11-
'https://download.tarantool.org/tarantool/release/' +
13+
'https://download.tarantool.org/tarantool/' +
14+
(nightlyBuild ? '' : 'release/') +
1215
core.getInput('tarantool-version', {required: true})
1316

1417
interface CaptureOptions {

0 commit comments

Comments
 (0)