-
Notifications
You must be signed in to change notification settings - Fork 15
86 lines (72 loc) · 2.77 KB
/
checks.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Checks
on:
pull_request:
branches: "*"
jobs:
test_and_lint:
runs-on: macos-12
env:
DEVNET_SHA: a0d87f2f621adb6278c1bdba523ddb58268bf483
steps:
- uses: actions/checkout@v3
- name: Cache/Restore Mint packages
id: mint-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/mint
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
restore-keys: ${{ runner.os }}-mint-
- name: Check if Mint is installed
id: mint-installed
run: brew list | grep mint
continue-on-error: true
- name: Upgrade package manager "Mint"
if: steps.mint-installed.outcome == 'success'
run: |
brew upgrade mint
- name: Install package manager "Mint"
if: steps.mint-installed.outcome != 'success'
run: |
brew install mint
- name: Install command line tool (if not yet cached)
if: steps.mint-cache.outputs.cache-hit != 'true'
run: mint bootstrap
- name: Run SwiftFormat lint
run: mint run swiftformat --lint .
# TODO: Replace with installing release when release is available
- name: Clone starknet-devnet-rs
run: |
git clone https://github.com/0xSpaceShard/starknet-devnet-rs.git starknet-devnet-rs
pushd ${{ github.workspace }}/starknet-devnet-rs
git checkout ${{ env.DEVNET_SHA }}
popd
- name: Cache devnet build
uses: actions/cache@v3
with:
path: starknet-devnet-rs/target/release
key: ${{ runner.os }}-starknet-devnet-rs-target-release-${{ env.DEVNET_SHA }}
- name: Build devnet
run: |
if [[ ! -d ${{ github.workspace }}/starknet-devnet-rs/target/release ]]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
pushd ${{ github.workspace }}/starknet-devnet-rs
cargo build --release
popd
else
echo "Found existing starknet-devnet-rs build, skipping compilation."
fi
- name: Setup scarb 0.7.0
uses: software-mansion/[email protected]
with:
scarb-version: "0.7.0"
- name: Install sncast 0.6.0
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/foundry-rs/starknet-foundry/master/scripts/install.sh | sh -s -- -v 0.6.0
source /Users/runner/.bashrc
echo "$(dirname $(which sncast))" >> $GITHUB_PATH
- name: Run tests
run: |
export DEVNET_PATH=${{ github.workspace }}/starknet-devnet-rs/target/release/starknet-devnet
export SCARB_PATH="$(which scarb)"
export SNCAST_PATH="$(which sncast)"
swift test --disable-sandbox