forked from lithdew/solana-zig
-
Notifications
You must be signed in to change notification settings - Fork 6
84 lines (71 loc) · 2.02 KB
/
main.yml
File metadata and controls
84 lines (71 loc) · 2.02 KB
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
name: Main
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
env:
SOLANA_ZIG_VERSION: v1.52.0
SOLANA_ZIG_DIR: solana-zig
jobs:
library:
name: Build and test library
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
with:
path: $SOLANA_ZIG_DIR
key: solana-zig-$SOLANA_ZIG_VERSION
- name: Download solana-zig compiler
shell: bash
run: ./install-solana-zig.sh $SOLANA_ZIG_DIR
- name: Test library
shell: bash
run: |
$SOLANA_ZIG_DIR/zig build test --summary all
programs:
name: Build and test programs
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
$SOLANA_ZIG_DIR
key: solana-zig-${{ hashFiles('./program-test/Cargo.lock') }}-$SOLANA_ZIG_VERSION
- name: Download solana-zig compiler
shell: bash
run: ./install-solana-zig.sh $SOLANA_ZIG_DIR
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.86.0
# took the workaround from https://github.com/sfackler/rust-openssl/issues/2149
- name: Set Perl environment variables
if: runner.os == 'Windows'
run: |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Install build deps
shell: bash
run: ./program-test/install-build-deps.sh
- name: Build and test program
shell: bash
run: ./program-test/test.sh