Skip to content

test: skip community in regular tests #320

test: skip community in regular tests

test: skip community in regular tests #320

Workflow file for this run

name: Test Templates
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
on:
# temporary to test fix
pull_request:
branches:
- '**'
push:
branches:
- main
paths-ignore:
- '**/*.md'
schedule:
- cron: '20 4 * * *'
workflow_dispatch:
jobs:
setup-templates:
runs-on: ubuntu-latest
outputs:
templates: ${{ steps.set-matrix.outputs.templates }}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
uses: ./.github/workflows/actions/install-dependencies
with:
version: 'current'
- name: Build
run: pnpm build
- id: set-matrix
shell: bash
run: |
CLI_PATH="${{ github.workspace }}/dist/bin/index.cjs"
templates=$(node "$CLI_PATH" --list-template-ids | jq -c 'map(select(contains("/community/") | not))')
echo "templates=$templates" >> "$GITHUB_OUTPUT"
test:
runs-on: ubuntu-latest
needs: [setup-templates]
strategy:
matrix:
node: [20, 22]
pm: [npm, pnpm, yarn]
template: ${{ fromJson(needs.setup-templates.outputs.templates) }}
steps:
- name: Setup Anchor
uses: metadaoproject/setup-anchor@v3.1
with:
anchor-version: '0.30.1'
solana-cli-version: '2.0.21'
node-version: ${{ matrix.node }}
- name: Configure Git identity
run: |
git config --global user.email "ci-bot@example.com"
git config --global user.name "CI Bot"
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: pnpm install
- run: pnpm build
- name: Install package manager (if needed)
run: |
case ${{ matrix.pm }} in
npm) echo "Using npm";;
pnpm) npm install -g pnpm;;
yarn) npm install -g yarn;;
esac
- name: Create and Build using create-solana-dapp
run: |
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"
CLI_PATH="${{ github.workspace }}/dist/bin/index.cjs"
case ${{ matrix.pm }} in
npm) node "$CLI_PATH" --template ${{ matrix.template }} sandbox ;;
pnpm) node "$CLI_PATH" --template ${{ matrix.template }} sandbox --pnpm ;;
yarn) node "$CLI_PATH" --template ${{ matrix.template }} sandbox --yarn ;;
esac
cd sandbox
${{ matrix.pm }} install
${{ matrix.pm }} run ci