-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (62 loc) · 2.32 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI
on:
pull_request:
push:
branches:
- main
merge_group:
jobs:
test:
name: test ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- 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
$location = (Invoke-WebRequest -Uri "https://github.com/software-mansion/scarb-nightlies/releases/latest" -Method Head -MaximumRedirection 0 -SkipHttpErrorCheck -ErrorAction Ignore).Headers.Location
$latest_version = ($location -replace '^.*/nightly-','nightly-')
echo "Latest Scarb nightly version found is $latest_version"
echo "LATEST_NIGHTLY_VERSION=$latest_version" >> $env:GITHUB_OUTPUT
- name: "Check Scarb latest"
uses: asdf-vm/actions/plugin-test@v3
with:
command: scarb --version | grep "scarb ${{ steps.version.outputs.LATEST_VERSION }}"
- name: "Check Scarb v0.5.2"
uses: asdf-vm/actions/plugin-test@v3
with:
skip_install: true
version: 0.5.2
command: scarb --version | grep "scarb 0.5.2"
- name: "Check Scarb latest:nightly"
uses: asdf-vm/actions/plugin-test@v3
with:
skip_install: true
version: latest:nightly
command: scarb --version | grep "${{ steps.version.outputs.LATEST_NIGHTLY_VERSION }}"
- name: "Check Scarb nightly-2023-08-10"
uses: asdf-vm/actions/plugin-test@v3
with:
skip_install: true
version: nightly-2023-08-10
command: scarb --version | grep "scarb 0.6.0+nightly-2023-08-10"
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: shellcheck bin/* lib/*
shfmt:
runs-on: ubuntu-latest
steps:
- uses: mfinelli/setup-shfmt@v3
- uses: actions/checkout@v4
- run: shfmt --diff .