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

feat: bump anchor action to 0.30.1 #95

Merged
merged 4 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 36 additions & 28 deletions .github/workflows/anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,30 @@ jobs:
strategy:
matrix:
node-version: [20.x]
solana-version: [1.18.8, beta]
anchor-version: [0.30.0]
solana-version: [1.18.8, stable]
anchor-version: [0.30.1]
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
if: github.event_name == 'pull_request'
id: changes
with:
list-files: shell
filters: |
anchor:
- added|modified: '**/anchor/**'
anchor_action:
- added|modified: '**/workflows/anchor.yml'

- name: Setup Anchor
if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule'
uses: heyAyushh/[email protected]
with:
anchor-version: ${{ matrix.anchor-version }}
solana-cli-version: ${{ matrix.solana-version }}
node-version: ${{ matrix.node-version }}
- name: Display versions
- name: Display versions and Install pnpm
if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule'
run: |
solana -V
solana-keygen new --no-bip39-passphrase
Expand All @@ -38,16 +51,8 @@ jobs:
npm i -g pnpm
# Run only if it's triggered by PR to main,
# Build the changed programs
- uses: dorny/paths-filter@v3
if: github.event_name == 'pull_request'
id: changes
with:
list-files: shell
filters: |
anchor:
- added|modified: '**/anchor/**'
- name: Build Changed Anchor programs
if: ${{ steps.changes.outputs.anchor == 'true' }}
if: steps.changes.outputs.anchor == 'true' && steps.changes.outputs.anchor_action != 'true'
run: |
changed_files=(${{ steps.changes.outputs.anchor_files }})

Expand Down Expand Up @@ -91,7 +96,7 @@ jobs:
shell: bash
# Skip Building all Programs if it's a PR to main branch
- name: Build All Anchor programs
if: github.event_name != 'pull_request'
if: github.event_name == 'schedule' || steps.changes.outputs.anchor_action == 'true'
run: |
# Find all anchor projects and remove ignored projects
declare -a ProjectDirs=($(find . -type d -name 'anchor' | sed 's|^\./||'| grep -v -f <(grep . .github/.ghaignore | grep -v '^$')))
Expand Down Expand Up @@ -132,35 +137,38 @@ jobs:
strategy:
matrix:
node-version: [20.x]
solana-version: [1.18.8, beta]
solana-version: [1.18.8, stable]
anchor-version: [0.30.0]
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
if: github.event_name == 'pull_request'
id: changes
with:
list-files: shell
filters: |
anchor:
- added|modified: '**/anchor/**'
anchor_action:
- added|modified: '**/workflows/anchor.yml'
# Skip Installing and Displaying versions if theres no change in anchor programs or anchor action workflow file or isn't a schedule event
- name: Setup Anchor
if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule'
uses: heyAyushh/[email protected]
with:
anchor-version: ${{ matrix.anchor-version }}
solana-cli-version: ${{ matrix.solana-version }}
node-version: ${{ matrix.node-version }}
- name: Display versions
- name: Display versions and Install pnpm
if: steps.changes.outputs.anchor == 'true' || steps.changes.outputs.anchor_action == 'true' || github.event_name == 'schedule'
run: |
solana -V
solana-keygen new --no-bip39-passphrase
rustc -V
anchor -V
npm i -g pnpm
# Run only if it's triggered by PR to main,
# Test the changed programs (if any)
- uses: dorny/paths-filter@v3
if: github.event_name == 'pull_request'
id: changes
with:
list-files: shell
filters: |
anchor:
- added|modified: '**/anchor/**'
- name: Test Changed Anchor Programs
if: ${{ steps.changes.outputs.anchor == 'true' }}
if: steps.changes.outputs.anchor == 'true' && steps.changes.outputs.anchor_action != 'true'
run: |
changed_files=(${{ steps.changes.outputs.anchor_files }})
ProjectDirs=($(for file in "${changed_files[@]}"; do dirname "${file}" | grep anchor | sed 's#/anchor/.*#/anchor#g'; done | grep -v -f <(grep . .github/.ghaignore | grep -v '^$') | sort -u))
Expand Down Expand Up @@ -192,9 +200,9 @@ jobs:
echo "All tests passed."
fi
shell: bash
# Skip Testing all Programs if it's a PR to main branch
# Skip Testing all Programs if it's a CRON job or a change in the workflow file
- name: Test All Anchor Programs
if: github.event_name != 'pull_request'
if: github.event_name == 'schedule' || steps.changes.outputs.anchor_action == 'true'
run: |
declare -a ProjectDirs=($(find . -type d -name "anchor"| grep -v -f <(grep . .github/.ghaignore | grep -v '^$')))
echo "Projects to Test:"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/solana-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
node-version: [20.x]
solana-version: [stable, beta]
solana-version: [stable]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
strategy:
matrix:
node-version: [20.x]
solana-version: [1.17.25, stable, beta]
solana-version: [1.17.25, stable]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion basics/hello-solana/anchor/tests/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as anchor from '@coral-xyz/anchor';
import type { HelloSolana } from '../target/types/hello_solana';
import { HelloSolana } from '../target/types/hello_solana';

describe('hello-solana', () => {
// Configure the Anchor provider & load the program IDL
Expand Down
5 changes: 3 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
"organizeImports": {
"enabled": true
},
Expand All @@ -13,7 +13,8 @@
"noExportsInTest": "warn"
},
"style": {
"noParameterAssign": "warn"
"noParameterAssign": "warn",
"useImportType": "off"
},
"complexity": {
"noForEach": "warn",
Expand Down
Loading
Loading