-
Notifications
You must be signed in to change notification settings - Fork 523
109 lines (99 loc) · 3.03 KB
/
integration-reusable.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
name: Integration Reusable Test
on:
workflow_call:
inputs:
name:
required: true
type: string
cache:
required: true
type: boolean
build_token_metadata:
required: true
type: boolean
changes:
required: true
type: boolean
env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.14.13
RUST_TOOLCHAIN: 1.65.0
CACHE: ${{ inputs.cache }}
jobs:
changes:
name: Changes
runs-on: ubuntu-latest
timeout-minutes: 10
# Set job outputs to values from filter step
outputs:
core: ${{ steps.filter.outputs.core }}
package: ${{ steps.filter.outputs.package }}
workflow: ${{ steps.filter.outputs.workflow }}
steps:
- uses: actions/checkout@v3
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/**'
package:
- '${{ inputs.name }}/**'
workflow:
- '.github/workflows/integration-reusable.yml'
build-and-test:
name: Build and Test
runs-on: ubuntu-latest-16-cores
needs: changes
if: |
inputs.changes == false ||
needs.changes.outputs.core == 'true' ||
needs.changes.outputs.package == 'true' ||
needs.changes.outputs.workflow == 'true'
steps:
# Setup Deps
- uses: actions/checkout@v3
- uses: ./.github/actions/install-linux-build-deps
- uses: ./.github/actions/install-solana
with:
solana_version: ${{ env.SOLANA_VERSION }}
- uses: ./.github/actions/install-rust
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
# Restore Cache from previous build/test
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./${{ inputs.name }}/program/target/
key: program-${{ inputs.name }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
if: ${{ env.CACHE != 'false' }}
# Dump program binaries
- uses: ./.github/actions/program/token-metadata-and-metaplex
# Build Rust Programs
- uses: ./.github/actions/build-program
with:
name: ${{ inputs.name }}
# Install JS SDK deps
- uses: ./.github/actions/yarn-install-and-build
with:
cache_id: sdk-${{ inputs.name }}
working_dir: ./${{ inputs.name }}/js
# Start local validator
- name: start-local-test-validator
working-directory: ./${{ inputs.name }}/js
run: DEBUG=amman* yarn amman:start
# Run integration test
- name: run-integration-test
id: run_integration_test
working-directory: ./${{ inputs.name }}/js
run: DEBUG=mpl* yarn test
# Stop local validator
- name: stop-local-test-validator
working-directory: ./${{ inputs.name }}/js
run: yarn amman:stop
continue-on-error: true