Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove Rust workspace #754

Merged
merged 42 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c3f7d4a
chore: remove Rust workspace
samuelvanderwaal Sep 21, 2022
b61e464
chore: remove unneeded fixtures dir
samuelvanderwaal Sep 21, 2022
22dbd71
enable multi-threaded tests
samuelvanderwaal Sep 21, 2022
c59030b
change worfklows to run on self-hosted
samuelvanderwaal Sep 21, 2022
1467a1f
update files to use test-programs dir
samuelvanderwaal Sep 21, 2022
7787b16
chore: merge master into branch
samuelvanderwaal Sep 21, 2022
2b736ea
chore: merge master into branch
samuelvanderwaal Sep 21, 2022
661ea1b
Merge branch 'master' into chore/remove-rust-workspace
samuelvanderwaal Sep 21, 2022
40fcc2f
chore: add bpf out dir for fixed price sale
samuelvanderwaal Sep 21, 2022
4caf22e
Merge branch 'master' into chore/remove-rust-workspace
Sep 22, 2022
9dc9fe2
Merge branch 'master' into chore/remove-rust-workspace
samuelvanderwaal Sep 22, 2022
34d4a7d
Merge branch 'master' into chore/remove-rust-workspace
samuelvanderwaal Sep 22, 2022
b93bcac
Merge branch 'master' into chore/remove-rust-workspace
samuelvanderwaal Sep 23, 2022
6c122ef
Merge branch 'master' into chore/remove-rust-workspace
samuelvanderwaal Sep 23, 2022
a1f7bd0
chore: fix auction house format issue
samuelvanderwaal Sep 23, 2022
fbb0f94
Merge branch 'master' into chore/remove-rust-workspace
samuelvanderwaal Sep 23, 2022
0ab420a
try install clang instead of clang7
samuelvanderwaal Sep 24, 2022
d2959c4
I have no idea what I'm doing
samuelvanderwaal Sep 24, 2022
00d4ded
one more try
samuelvanderwaal Sep 24, 2022
8b1f440
:
samuelvanderwaal Sep 24, 2022
db4f994
build-essential
samuelvanderwaal Sep 24, 2022
d7fbda4
fix name
samuelvanderwaal Sep 24, 2022
6df868b
ci: use buildjet instances
samuelvanderwaal Sep 26, 2022
5dab20e
ci: remove unneeded dev installs
samuelvanderwaal Sep 26, 2022
14000d9
upgrade before installing libudev
samuelvanderwaal Sep 26, 2022
959904d
update bubblegum & other ci workflows
samuelvanderwaal Sep 26, 2022
0d3e98d
fix flakey tests
samuelvanderwaal Sep 26, 2022
67db43e
nft-packs: add metaplex program; use Confirmed level
samuelvanderwaal Sep 26, 2022
ce70672
fixed-price-sale: add mpl-metaplex program to tests
samuelvanderwaal Sep 26, 2022
6f9f056
disable sec3
samuelvanderwaal Sep 26, 2022
fe65aba
nft-packs/fixed-price-sale: fix paths
samuelvanderwaal Sep 26, 2022
460a0af
Merge branch 'master' into chore/remove-rust-workspace
samuelvanderwaal Sep 27, 2022
40dead3
change fixed price sale tests to use Confirmed
samuelvanderwaal Sep 27, 2022
24d764b
Merge branch 'chore/remove-rust-workspace' of github.com:metaplex-fou…
samuelvanderwaal Sep 27, 2022
6941f31
upgrade buildjet instance; bump tm idl shank binary version
samuelvanderwaal Sep 27, 2022
bedf3f4
revert to 4vcpu, to try to unstuck things
samuelvanderwaal Sep 27, 2022
6b2c0e7
revert to Github runners
samuelvanderwaal Sep 28, 2022
2107c38
merge master into branch
samuelvanderwaal Sep 28, 2022
24784df
address review comments
samuelvanderwaal Sep 28, 2022
1d9e3e6
remove bpf-out-dir; change checkout to v3
samuelvanderwaal Sep 30, 2022
62ed9bb
merge master into branch
samuelvanderwaal Oct 3, 2022
08e1bc1
only apt update once
samuelvanderwaal Oct 3, 2022
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
64 changes: 32 additions & 32 deletions .base-ammanrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,52 @@
'use strict';
const path = require('path');

const localDeployDir = path.join(__dirname, 'target', 'deploy');
const {LOCALHOST, tmpLedgerDir} = require('@metaplex-foundation/amman');
const localDeployDir = path.join(__dirname, 'test-programs');
const { LOCALHOST, tmpLedgerDir } = require('@metaplex-foundation/amman');

function localDeployPath(programName) {
return path.join(localDeployDir, `${programName}.so`);
return path.join(localDeployDir, `${programName}.so`);
}

const programs = {
metadata: {
label: "Metadata",
programId: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
deployPath: localDeployPath('mpl_token_metadata')
},
token_sale: {
label: "Fixed Price Token Sale",
programId: 'SaLeTjyUa5wXHnGuewUSyJ5JWZaHwz3TxqUntCE9czo',
deployPath: localDeployPath('mpl_fixed_price_sale'),
},
candy_machine: {
label: "Candy Machine",
programId: 'cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ',
deployPath: localDeployPath('mpl_candy_machine'),
metadata: {
label: 'Metadata',
programId: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
deployPath: localDeployPath('mpl_token_metadata'),
},
hydra: {
token_sale: {
label: 'Fixed Price Token Sale',
programId: 'SaLeTjyUa5wXHnGuewUSyJ5JWZaHwz3TxqUntCE9czo',
deployPath: localDeployPath('mpl_fixed_price_sale'),
},
candy_machine: {
label: 'Candy Machine',
programId: 'cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ',
deployPath: localDeployPath('mpl_candy_machine'),
},
hydra: {
label: 'Hydra',
programId: 'hyDQ4Nz1eYyegS6JfenyKwKzYxRsCWCriYSAjtzP4Vg',
deployPath: localDeployPath('mpl_hydra'),
},
};

const validator = {
killRunningValidators: true,
programs,
commitment: 'singleGossip',
resetLedger: true,
verifyFees: false,
jsonRpcUrl: LOCALHOST,
websocketUrl: '',
ledgerDir: tmpLedgerDir(),
killRunningValidators: true,
programs,
commitment: 'singleGossip',
resetLedger: true,
verifyFees: false,
jsonRpcUrl: LOCALHOST,
websocketUrl: '',
ledgerDir: tmpLedgerDir(),
};

module.exports = {
programs,
validator,
relay: {
enabled: true,
killRunningRelay: true,
},
programs,
validator,
relay: {
enabled: true,
killRunningRelay: true,
},
};
3 changes: 2 additions & 1 deletion .github/actions/build-auction-house/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ runs:
- name: build-auction-house-program
working-directory: ./auction-house/program
run: |
mkdir -p ../../test-programs
cargo +${{ env.RUST_STABLE }} build-bpf --version
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../target/deploy/
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../test-programs/
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/build-fixed-price-sale/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ runs:
working-directory: ./fixed-price-sale/program
run: |
cargo +${{ env.RUST_STABLE }} build-bpf --version
cargo +${{ env.RUST_STABLE }} build-bpf
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../test-programs
shell: bash
3 changes: 2 additions & 1 deletion .github/actions/build-hydra/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ runs:
- name: build-hydra-program
working-directory: ./hydra/program
run: |
mkdir -p ../../test-programs
cargo +${{ env.RUST_STABLE }} build-bpf --version
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../target/deploy/
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../test-programs/
shell: bash
3 changes: 2 additions & 1 deletion .github/actions/build-token-metadata/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ runs:
- name: build-token-metadata-program
working-directory: ./token-metadata/program
run: |
mkdir -p ../../test-programs
cargo +${{ env.RUST_STABLE }} build-bpf --version
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../target/deploy/
cargo +${{ env.RUST_STABLE }} build-bpf --bpf-out-dir ../../test-programs/
shell: bash
13 changes: 3 additions & 10 deletions .github/actions/install-linux-build-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,17 @@ runs:
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main"
sudo apt-get update
thlorenz marked this conversation as resolved.
Show resolved Hide resolved
sudo apt-get upgrade
shell: bash

- name: apt-get install clang
run: |
sudo apt-get install -y clang-7 --allow-unauthenticated
clang-7 --version
shell: bash

- name: apt-get install ssl libs
run: |
sudo apt-get install -y openssl --allow-unauthenticated
sudo apt-get install -y libssl-dev --allow-unauthenticated
sudo apt-get install -y libssl1.1 --allow-unauthenticated
shell: bash

- name: apt-get install dev tools
- name: apt-get install libudev
run: |
sudo apt-get install -y libudev-dev
sudo apt-get install -y binutils-dev
sudo apt-get install -y libunwind-dev
sudo apt-get install libudev-dev
shell: bash
28 changes: 15 additions & 13 deletions .github/workflows/integration-fixed-price-sale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,26 @@ jobs:
package: ${{ steps.filter.outputs.package }}
workflow: ${{ steps.filter.outputs.workflow }}
steps:
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/**'
package:
- 'fixed-price-sale/**'
workflow:
- '.github/workflows/integration-fixed-price-sale.yml '
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/**'
package:
- 'fixed-price-sale/**'
workflow:
- '.github/workflows/integration-fixed-price-sale.yml '
build-and-integration-test-fixed-price-sale:
runs-on: buildjet-4vcpu-ubuntu-2204
env:
cache_id: program-fixed-price-sale
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' || needs.changes.outputs.workflow == 'true' }}
if:
${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' ||
needs.changes.outputs.workflow == 'true' }}
steps:
# Setup Deps
- uses: actions/checkout@v2
Expand Down
34 changes: 19 additions & 15 deletions .github/workflows/integration-hydra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,26 @@ jobs:
package: ${{ steps.filter.outputs.package }}
workflow: ${{ steps.filter.outputs.workflow }}
steps:
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/**'
package:
- 'hydra/**'
workflow:
- '.github/workflows/integration-hydra.yml'
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/**'
package:
- 'hydra/**'
workflow:
- '.github/workflows/integration-hydra.yml'
build-and-integration-test-hydra:
runs-on: buildjet-4vcpu-ubuntu-2204
env:
cache_id: program-hydra
needs: changes
if: ${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' || needs.changes.outputs.workflow == 'true' }}
if:
${{ needs.changes.outputs.core == 'true' || needs.changes.outputs.package == 'true' ||
needs.changes.outputs.workflow == 'true' }}
steps:
# Setup Deps
- uses: actions/checkout@v2
Expand All @@ -58,7 +60,9 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
./rust/target
key: ${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUSTC_HASH }}
key:
${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{
env.RUSTC_HASH }}

# Build Rust Program
- uses: ./.github/actions/build-hydra
Expand All @@ -80,7 +84,7 @@ jobs:
# id: run_integration_test
# working-directory: ./hydra/js
# run: DEBUG=mpl* yarn test

# - name: stop-local-test-validator
# working-directory: ./hydra/js
# run: yarn amman:stop
3 changes: 2 additions & 1 deletion .github/workflows/program-auction-house.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@ jobs:
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../target/deploy/ --test ${{ env.TEST }} -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../test-programs/ --test ${{ env.TEST }} -- --nocapture --test-threads 1

2 changes: 1 addition & 1 deletion .github/workflows/program-auctioneer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ jobs:
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../target/deploy/ --test ${{ env.TEST }} -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../test-programs/ --test ${{ env.TEST }} -- --nocapture --test-threads 1
2 changes: 1 addition & 1 deletion .github/workflows/program-bubblegum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ jobs:
working-directory: ./bubblegum/program
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../target/deploy/ --test ${{ env.TEST }} -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../test-programs/ --test ${{ env.TEST }} -- --nocapture --test-threads 1
26 changes: 14 additions & 12 deletions .github/workflows/program-candy-machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
core: ${{ steps.filter.outputs.core }}
package: ${{ steps.filter.outputs.package }}
steps:
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/rust/**'
package:
- 'candy-machine/program/**'
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/rust/**'
package:
- 'candy-machine/program/**'

build-and-test-candy-machine:
needs: changes
Expand Down Expand Up @@ -57,7 +57,9 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
./rust/target
key: ${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUSTC_HASH }}
key:
${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{
env.RUSTC_HASH }}

# Run lint checks
- uses: ./.github/actions/verify-rust
Expand All @@ -74,4 +76,4 @@ jobs:
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../target/deploy/ -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../test-programs/ -- --nocapture --test-threads 1
12 changes: 10 additions & 2 deletions .github/workflows/program-fixed-price-sale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,21 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
./rust/target
key: ${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUSTC_HASH }}
key:
${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{
env.RUSTC_HASH }}

# Build deps
- uses: ./.github/actions/build-token-metadata

# Get Metaplex program
- name: Get Metaplex program
run: |
solana program dump p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98 test-programs/mpl_metaplex.so

# Run test
- name: test-fixed-price-sale-program
id: run_test
working-directory: ./fixed-price-sale/program
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf -- --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../test-programs -- --nocapture --test-threads 1
26 changes: 14 additions & 12 deletions .github/workflows/program-gumdrop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
core: ${{ steps.filter.outputs.core }}
package: ${{ steps.filter.outputs.package }}
steps:
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/rust/**'
package:
- 'gumdrop/program/**'
- uses: actions/checkout@v2
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
core:
- 'core/rust/**'
package:
- 'gumdrop/program/**'

build-and-test-gumdrop:
needs: changes
Expand Down Expand Up @@ -57,7 +57,9 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
./rust/target
key: ${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUSTC_HASH }}
key:
${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{
env.RUSTC_HASH }}

# Build deps
- uses: ./.github/actions/build-token-metadata
Expand All @@ -69,4 +71,4 @@ jobs:
run: |
cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../target/deploy/ -- --nocapture --test-threads 1
cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --bpf-out-dir ../../test-programs/ -- --nocapture --test-threads 1
4 changes: 2 additions & 2 deletions .github/workflows/program-hydra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ jobs:
# id: run_test
# working-directory: ./hydra/program
# run: |
# cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture --test-threads 1
# cargo +${{ env.RUST_TOOLCHAIN }} test -- --nocapture
# cargo +${{ env.RUST_TOOLCHAIN }} test-bpf --version
# cargo +${{ env.RUST_TOOLCHAIN }} test-bpf -- --nocapture --test-threads 1
# cargo +${{ env.RUST_TOOLCHAIN }} test-bpf -- --nocapture --test-threads 1
Loading