From 6b83776dff88585cd01215e0b6b05b9cab4cc8be Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 13:36:11 +0200 Subject: [PATCH 01/10] gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c3946ed --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.anchor/ +target/ \ No newline at end of file From c269cbcf20d455f66e92a0f51fe7cadf446c9004 Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 13:36:28 +0200 Subject: [PATCH 02/10] initialize codeowner --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..3c09ee7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @brewmaster012 @lumtis @fbac @ws4charlie \ No newline at end of file From b37fe29d9902133c4c6b515de9e73f55a95a07bc Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 13:38:34 +0200 Subject: [PATCH 03/10] build and test workflow --- .github/workflows/build.yml | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..73db56f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Install Solana CLI + run: | + sh -c "$(curl -sSfL https://release.solana.com/v1.8.2/install)" + echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH + + - name: Install Anchor + run: | + cargo install --git https://github.com/project-serum/anchor anchor-cli --locked + + - name: Anchor version + run: anchor --version + + - name: Solana version + run: solana --version + + - name: Setup Solana config + run: | + solana config set --url https://api.devnet.solana.com + solana config set --keypair ~/.config/solana/id.json + + - name: Run Anchor build + run: anchor build + + - name: Run Anchor tests + run: anchor test \ No newline at end of file From 097da1d26bce1629d8cd5e26a93548a8b7e282d2 Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 13:51:41 +0200 Subject: [PATCH 04/10] some modifications --- .github/workflows/build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73db56f..efb6992 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,12 +24,20 @@ jobs: - name: Install Solana CLI run: | - sh -c "$(curl -sSfL https://release.solana.com/v1.8.2/install)" + sh -c "$(curl -sSfL https://release.solana.com/v1.18.17/install)" echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH - name: Install Anchor run: | - cargo install --git https://github.com/project-serum/anchor anchor-cli --locked + cargo install --git https://github.com/coral-xyz/anchor avm --locked --force + + - name: Install Anchor latest version + run: | + avm install latest + + - name: Set Anchor latest version + run: | + avm use latest - name: Anchor version run: anchor --version From d96ad1bfc3d9dd422cdfeab953243a8de0e4d991 Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 14:32:16 +0200 Subject: [PATCH 05/10] test action --- .github/workflows/build.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efb6992..346af7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,31 +24,18 @@ jobs: - name: Install Solana CLI run: | - sh -c "$(curl -sSfL https://release.solana.com/v1.18.17/install)" + sh -c "$(curl -sSfL https://release.solana.com/v1.18.15/install)" echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH - name: Install Anchor run: | - cargo install --git https://github.com/coral-xyz/anchor avm --locked --force + cargo install --git https://github.com/coral-xyz/anchor --tag v0.30.0 anchor-cli --locked - - name: Install Anchor latest version - run: | - avm install latest - - - name: Set Anchor latest version - run: | - avm use latest + - name: Generate new keygen + run: solana-keygen new - - name: Anchor version - run: anchor --version - - - name: Solana version - run: solana --version - - - name: Setup Solana config - run: | - solana config set --url https://api.devnet.solana.com - solana config set --keypair ~/.config/solana/id.json + - name: Install yarn dependencies + run: yarn install - name: Run Anchor build run: anchor build From 3282e8742d0005ad3fe503d0fa3ea7631f998dce Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 14:51:57 +0200 Subject: [PATCH 06/10] retry solana config --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 346af7c..692918d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,8 +31,15 @@ jobs: run: | cargo install --git https://github.com/coral-xyz/anchor --tag v0.30.0 anchor-cli --locked - - name: Generate new keygen - run: solana-keygen new + - name: Generate Solana keypair + run: | + mkdir -p ~/.config/solana + solana-keygen new --outfile ~/.config/solana/id.json + + - name: Setup Solana config + run: | + solana config set --url https://api.devnet.solana.com + solana config set --keypair ~/.config/solana/id.json - name: Install yarn dependencies run: yarn install From ccd2ec0243ff517332c0a0f1ff67f6cca65baea4 Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 15:32:52 +0200 Subject: [PATCH 07/10] test with action from metadaoproject --- .github/workflows/build.yml | 47 +++++++------------------------------ 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 692918d..c5dbc86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,43 +9,12 @@ on: - main jobs: - build: - runs-on: ubuntu-latest - + run-anchor-test: + runs-on: ubuntu-20.04 steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Install Solana CLI - run: | - sh -c "$(curl -sSfL https://release.solana.com/v1.18.15/install)" - echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH - - - name: Install Anchor - run: | - cargo install --git https://github.com/coral-xyz/anchor --tag v0.30.0 anchor-cli --locked - - - name: Generate Solana keypair - run: | - mkdir -p ~/.config/solana - solana-keygen new --outfile ~/.config/solana/id.json - - - name: Setup Solana config - run: | - solana config set --url https://api.devnet.solana.com - solana config set --keypair ~/.config/solana/id.json - - - name: Install yarn dependencies - run: yarn install - - - name: Run Anchor build - run: anchor build - - - name: Run Anchor tests - run: anchor test \ No newline at end of file + - uses: actions/checkout@v3 + - uses: metadaoproject/anchor-test@v2 + with: + anchor-version: '0.30.1' + solana-cli-version: '1.18.15' + node-version: '16.20.2' \ No newline at end of file From 429d17b60dc04d47fc1f34ae42c812f8bb481657 Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 15:41:39 +0200 Subject: [PATCH 08/10] update git version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5dbc86..76690aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,4 +17,4 @@ jobs: with: anchor-version: '0.30.1' solana-cli-version: '1.18.15' - node-version: '16.20.2' \ No newline at end of file + node-version: 'v20.15.0' \ No newline at end of file From 8d5eca9e8001e9a0369c1744ad56dcd24055704c Mon Sep 17 00:00:00 2001 From: lumtis Date: Thu, 4 Jul 2024 16:10:18 +0200 Subject: [PATCH 09/10] try with default --- .github/workflows/build.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76690aa..9740c02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,4 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: metadaoproject/anchor-test@v2 - with: - anchor-version: '0.30.1' - solana-cli-version: '1.18.15' - node-version: 'v20.15.0' \ No newline at end of file + - uses: metadaoproject/anchor-test@v2 \ No newline at end of file From cea295c94fbddb154cd3a050ce97b4fda3605aa6 Mon Sep 17 00:00:00 2001 From: lumtis Date: Fri, 5 Jul 2024 14:20:43 +0200 Subject: [PATCH 10/10] rename action into test --- .github/workflows/{build.yml => test.yml} | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) rename .github/workflows/{build.yml => test.yml} (50%) diff --git a/.github/workflows/build.yml b/.github/workflows/test.yml similarity index 50% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index 9740c02..06803e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: build +name: test on: push: @@ -13,4 +13,8 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: metadaoproject/anchor-test@v2 \ No newline at end of file + - uses: metadaoproject/anchor-test@v2 + with: + anchor-version: '0.30.1' + solana-cli-version: '1.18.15' + node-version: 'v20.15.0' \ No newline at end of file