Skip to content

Use PowerShell in latest Scarb version fetch step #40

Use PowerShell in latest Scarb version fetch step

Use PowerShell in latest Scarb version fetch step #40

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
merge_group:
jobs:
test:
name: test ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: "Fetch latest Scarb version from GitHub releases"
id: version
shell: pwsh
run: |
$location = (Invoke-WebRequest -Uri "https://github.com/software-mansion/scarb/releases/latest" -Method Head -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction Ignore).Headers.Location
$latest_version = ($location -replace '^.*/v','')
echo "Latest Scarb version found is $latest_version"
echo "LATEST_VERSION=$latest_version" >> $env:GITHUB_OUTPUT
- name: "Setup Scarb without `scarb-version`"
uses: ./
- run: scarb --version | grep "scarb ${{ steps.version.outputs.LATEST_VERSION }}"
- name: "Setup Scarb with `scarb-version: 0.4.1`"
uses: ./
with:
scarb-version: 0.4.1
- run: scarb --version | grep "scarb 0.4.1"
- name: "Setup Scarb with `scarb-version: latest`"
uses: ./
with:
scarb-version: latest
- run: scarb --version | grep "scarb ${{ steps.version.outputs.LATEST_VERSION }}"
- name: "Create .tool-versions file"
run: echo "scarb 0.5.0" >> .tool-versions
- name: "Setup Scarb using `.tool-versions` file"
uses: ./
- run: scarb --version | grep "scarb 0.5.0"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- run: npm ci
- run: npm run lint