Update test.yml #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
- patch-v1 | |
pull_request: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
name: Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
version: [0.1.15] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install deps and build | |
run: npm ci && npm run build | |
- name: Setup kosli CLI | |
uses: ./ | |
with: | |
version: ${{ matrix.version }} | |
- name: Capture kosli version installed | |
run: | | |
export KOSLI_VERSION=$( kosli version --short) | |
echo 'KOSLI_VERSION_INSTALLED<<EOF' >> $GITHUB_ENV | |
kosli version --short >> $GITHUB_ENV | |
echo "\n" >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
- name: Verify | |
shell: python | |
env: | |
KOSLI_VERSION_EXPECTED: ${{ matrix.version }} | |
run: | | |
import sys, os | |
sys.exit( | |
int(not os.environ["KOSLI_VERSION_EXPECTED"] in os.environ["KOSLI_VERSION_INSTALLED"]) | |
) |