-
Notifications
You must be signed in to change notification settings - Fork 8
141 lines (129 loc) · 4.29 KB
/
test.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Test
on:
workflow_dispatch: {}
push:
branches: [main]
pull_request:
branches: [main]
permissions:
checks: write
contents: read
issues: read
pull-requests: write
env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.10.41
RUST_TOOLCHAIN: nightly
SOTERIA_VERSION: 0.0.0
ANCHOR_GIT: https://github.com/project-serum/anchor
ANCHOR_VERSION: 0.25.0
jobs:
rust-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: true
components: rustfmt, clippy
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
args: --all-features
rust-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: true
components: rustfmt, clippy
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Run fmt
run: cargo +nightly fmt
# soteria-scan:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions-rs/toolchain@v1
# with:
# override: true
# profile: minimal
# toolchain: ${{ env.RUST_TOOLCHAIN }}
# - uses: ./.github/actions/install-solana
# with:
# solana_version: ${{ env.SOLANA_VERSION }}
# - uses: ./.github/actions/install-soteria
# with:
# soteria_version: ${{ env.SOTERIA_VERSION }}
# - name: Soteria scan programs
# working-directory: ./programs
# run: >-
# for PROGRAM in ./*; do
# if [ -d "$PROGRAM" ]; then
# cd "$PROGRAM"
# echo "Soteria scan for $PROGRAM"
# soteria -analyzeAll .
# cd ..
# fi
# done
# shell: bash
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-linux-build-deps
- uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
- uses: ./.github/actions/install-solana
with:
solana_version: ${{ env.SOLANA_VERSION }}
# - uses: ./.github/actions/install-anchor
# with:
# anchor_git: ${{ env.ANCHOR_GIT }}
# anchor_version: ${{ env.ANCHOR_VERSION }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./rust/target
key: ${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUSTC_HASH }}
- name: Install Yarn dependencies
run: yarn install
- name: Setup
run: mkdir -p target/deploy
- name: build
run: cargo build-bpf
- name: Run local validator
run: solana-test-validator --url https://api.devnet.solana.com --clone metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s --clone PwDiXFxQsGra4sFFTT8r1QWRMd4vfumiWC1jfWNfdYT --clone 5qkkEWkKfGEuLZ4iveZzGSHZUM5WqyXTitsVr3TEU1Gp --clone CFDKv9emss3eeYDwGZMPd6CkZXYb9vpYgDGCEwojJp6i --clone cciMwwUJPstviYDc6w5pQkF5x8De12MGkMj54TUB3xS --bpf-program ccsxqYAg64wuLEh45KabyPvkKjrEfDPsDZUQrGn7mf3 ./target/deploy/solana_nft_programs_creator_standard.so --reset --quiet & echo $$! > validator.PID
- run: sleep 6
- run: solana airdrop 1000 $(solana-keygen pubkey ./tests/test-keypairs/test-key.json) --url http://localhost:8899
- run: yarn test
# - uses: dorny/test-reporter@v1
# if: always()
# with:
# artifact: test-results
# name: Local Tests
# path: tests/*.json
# reporter: mocha-json
- name: upload-integration-tests
if: always()
uses: actions/upload-artifact@v3
with:
name: Unit Test Results
path: tests/out.xml
- name: publish-integration-tests
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
files: tests/out.xml