Skip to content
Open
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0a372a9
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
d302105
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
269e479
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
ea23c98
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
22256b2
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
249c995
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
52efe28
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
35c0fe8
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
040392f
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
b1b354e
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
a58b23a
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
eddc636
Update paths and logic
sjoerd-dijkstra Mar 17, 2023
710bc7c
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 17, 2023
a78e118
Remove url
sjoerd-dijkstra Mar 17, 2023
51ce9b1
update paths
sjoerd-dijkstra Mar 17, 2023
fbb5501
Trigger ci
sjoerd-dijkstra Mar 17, 2023
87bfa32
Fix variable
sjoerd-dijkstra Mar 17, 2023
49e14a8
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 18, 2023
9e5b5a5
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 18, 2023
ff7c2a9
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 18, 2023
b8ecf25
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 18, 2023
ff5c03d
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 18, 2023
a4e7716
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 18, 2023
a7046cb
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 18, 2023
e7f3c8b
Update .nosana-ci.yml pipeline
nosana-platform[bot] Mar 18, 2023
bf1f0c2
Enable pipeline
sjoerd-dijkstra Mar 21, 2023
d9ee42d
Update pipeline
sjoerd-dijkstra Mar 21, 2023
1c28b1c
Configure solana
sjoerd-dijkstra Mar 21, 2023
51d235f
Fix solana artifact
sjoerd-dijkstra Mar 21, 2023
8e7bb51
Fix test and hash verification
sjoerd-dijkstra Mar 21, 2023
590032b
Fix local paths
sjoerd-dijkstra Mar 21, 2023
9c41806
Disable else
sjoerd-dijkstra Mar 21, 2023
346b4c3
Use shell shasum
sjoerd-dijkstra Mar 22, 2023
b90abee
Improve string compare
sjoerd-dijkstra Mar 22, 2023
ff306c5
Trigger ci
sjoerd-dijkstra Mar 22, 2023
052f372
Use solana verify
sjoerd-dijkstra Mar 22, 2023
78de4ec
Use test and set url before verify
sjoerd-dijkstra Mar 22, 2023
f28f4e0
Remove curly brace and &&
sjoerd-dijkstra Mar 22, 2023
0d1ab79
Remove double quotes
sjoerd-dijkstra Mar 22, 2023
feb2fb3
Use POSIX compliant string comparison
sjoerd-dijkstra Mar 22, 2023
c8ce39d
Use inline script
sjoerd-dijkstra Mar 22, 2023
d65685e
Update job name
sjoerd-dijkstra Mar 22, 2023
3e13913
approve tx test
laurensV Mar 22, 2023
32ffa00
Add test
sjoerd-dijkstra Mar 23, 2023
0ce3d50
Improve testing and variables
sjoerd-dijkstra Mar 23, 2023
0ff6145
Remove pipe from test cmd
sjoerd-dijkstra Mar 23, 2023
c26937f
Update env vars
sjoerd-dijkstra Mar 23, 2023
0a2f5b8
Disable hash check
sjoerd-dijkstra Mar 23, 2023
8f76c3f
add --approve option
laurensV Mar 23, 2023
5d1e3ee
Exit early when no buffer
sjoerd-dijkstra Mar 23, 2023
c9598a6
Trigger ci
sjoerd-dijkstra Mar 23, 2023
dd9bf3d
Update .nosana-ci.yml
laurensV Apr 3, 2023
42dd2a7
Update .nosana-ci.yml
laurensV Apr 3, 2023
8cb36cc
Update .nosana-ci.yml
laurensV Apr 5, 2023
907e7a5
Update .nosana-ci.yml
laurensV Apr 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 70 additions & 42 deletions .nosana-ci.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,81 @@
# .nosana-ci.yml
nosana:
description: Build and Test Nosana Contracts
backend: IPFS
description: Build and Test Nosana Contracts

global:
image: registry.hub.docker.com/projectserum/build:v0.25.0
image: projectserum/build:v0.27.0
environment:
SOLANA_URL: mainnet-beta # testnet / devnet / mainnet / your-custom-sol-rpc
PROGRAM_ID: nosJhNRqr2bc9g1nfGDcXXTXvYUmxD4cVwy2pMWhrYM
PROGRAM_NAME: nosana_jobs
PRIVATE_KEY_PATH: /root/.config/solana/id.json
SQUADS_AUTHORITY_PUBKEY: BnSjXUGSyLMA2x2xAexp3BnmCvk4xnhUkeygozpYiNeD
SQUADS_MULTISIG_PUBKEY: Hj7BpiinztTHA9vnTFdVuKRjfw7UybdRgdQEvYNquzY2
SQUADS_PROGRAM_PUBKEY: 9VYJe4S85ue8hMoM9UUKQPREHRWWJRUPSQYGpknJ6Xe7

# Trigger pipeline on these branches:
trigger:
branch:
- main
# Trigger pipeline on these branches:
trigger:
push:
branches:
- nosana-ci
tags:
- 'v*'

jobs:

- name: install
commands:
- npm ci
- name: build
commands:
- scripts/prepare.sh
- anchor build
artifacts:
- name: programs
path: target

artifacts:
- name: node_modules
path: ./node_modules/
- name: test
secrets:
- TEST_KEY
commands:
- echo "${TEST_KEY}" > "${PRIVATE_KEY_PATH}"
- npm ci
- anchor test
resources:
- name: programs
path: .

- name: npm lint
commands:
- npm run eslint
- npm run prettier
- npm run check-types
resources:
- node_modules
- name: deliver
image: nosana/solana:v1.0.18
secrets:
- SQUADS_KEY
commands:
- solana config set --url "${SOLANA_URL}"
- REMOTE_HASH="$(solana-verify get-program-hash "${PROGRAM_ID}")"
- echo "On chain hash is ${REMOTE_HASH}"
- LOCAL_HASH="$(solana-verify get-executable-hash "target/deploy/${PROGRAM_NAME}.so")"
- echo "Compiled hash is ${LOCAL_HASH}"
- |
if [ "${REMOTE_HASH}" = "${LOCAL_HASH}" ]
then
echo Programs are equal, deployment cancelled
exit 0
else
echo Continue deployment
fi
- echo "${SQUADS_KEY}" > "${PRIVATE_KEY_PATH}"
- BUFFER_ACCOUNT="$(solana program write-buffer "target/deploy/${PROGRAM_NAME}.so" | cut -d ' ' -f2)"
- if [ -z "${BUFFER_ACCOUNT}" ]; then exit 1; else echo "Buffer account is ${BUFFER_ACCOUNT}"; fi
- solana program set-buffer-authority "${BUFFER_ACCOUNT}" --new-buffer-authority "${SQUADS_AUTHORITY_PUBKEY}"
- |
nosana-cli create-program-upgrade \
--name nosanaJobs \
--private-key "${PRIVATE_KEY_PATH}" \
--buffer "${BUFFER_ACCOUNT}" \
--spill "$(solana address)" \
--network "${SOLANA_URL}" \
--multisig "${SQUADS_MULTISIG_PUBKEY}" \
--program "${SQUADS_PROGRAM_PUBKEY}" \
--authority "${SQUADS_AUTHORITY_PUBKEY}" \
--approve

- name: build
commands:
- anchor build
artifacts:
- name: anchor_target
path: ./target/

- name: anchor test
commands:
- solana-keygen new --no-bip39-passphrase
- anchor test --skip-build
resources:
- node_modules
- anchor_target

- name: rust lint
commands:
- cargo check --release
- cargo test --release
- cargo clippy --release
resources:
- anchor_target
resources:
- name: programs
path: .