Skip to content

ci: simplify test workflow #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 13 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,22 @@ jobs:
steps:
- uses: actions/checkout@v4

- id: get-latest
run: |
node <<'SCRIPT'
process.env["INPUT_TARANTOOL-VERSION"] = "${{ matrix.tarantool }}"
process.env["INPUT_NIGHTLY-BUILD"] = "${{ matrix.nightly }}"
require("./dist/main").latest_version().then(v => {
console.log(v)
require("./dist/main").setActionOutput('version', v);
})
SCRIPT
- id: latest-version
uses: ./.github/actions/latest-version
with:
tarantool-series: ${{ matrix.tarantool }}
nightly-build: ${{ matrix.nightly }}

- name: Setup from scratch
uses: ./
with:
tarantool-version: ${{ matrix.tarantool }}
nightly-build: ${{ matrix.nightly }}

- name: Check precise version
run: |
dpkg -s tarantool | grep '^Version: ${{ steps.get-latest.outputs.version }}'
# It'll also fail if tarantool is installed from cache but not from apt-get
- uses: ./.github/actions/verify-version
with:
tarantool-version: '${{ steps.latest-version.outputs.git-describe }}'
from-cache: false

- name: Uninstall tarantool
run: sudo apt-get -y remove tarantool tarantool-dev tarantool-common
Expand All @@ -67,23 +62,10 @@ jobs:
tarantool-version: ${{ matrix.tarantool }}
nightly-build: ${{ matrix.nightly }}

- name: Verify install from cache
run: |
# Fail if tarantool is installed from apt-get
if dpkg -s tarantool; then
echo "Tarantool wasn't restored from cache"
exit 1
fi

- name: Check branch version
run: |
T=$(tarantool -e 'print(_TARANTOOL:match("%d+%.%d+")); os.exit()')
if [ "$T" != "${{ matrix.tarantool }}" ]; then
echo "Tarantool version is $T, expected ${{ matrix.tarantool }}"
exit 1
else
echo "Tarantool version is $T, as expected"
fi
- uses: ./.github/actions/verify-version
with:
tarantool-version: '${{ steps.latest-version.outputs.git-describe }}'
from-cache: true

test-concurrency:
strategy:
Expand Down