Skip to content

Use full plaintext CC license #51

Use full plaintext CC license

Use full plaintext CC license #51

Workflow file for this run

# From https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs#using-the-nodejs-starter-workflow
name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# See https://github.com/metaDAOproject/setup-anchor for docs
- uses: metadaoproject/setup-anchor@v2.1
with:
anchor-version: "latest"
# Install Solana CLI (beta, required to fix 'ahash' issue)
solana-cli-version: "1.18.4"
node-version: "20.12.2"
# git will keep outputting:
# hint: Using 'master' as the name for the initial branch. This default branch name
# hint: is subject to change.
# Unless we set this.
- name: Set a default branch name for git
run: |
git config --global init.defaultBranch main
- name: Print versions and debugging info
run: |
echo Linux version:
lsb_release -a
echo Solana version:
solana -V
echo Anchor version:
anchor -V
echo build-sbf version:
cargo build-sbf --version
echo Path:
echo $PATH | tr ':' '\n' | sort
- name: Create a blank Anchor project
run: |
anchor init project
# TODO: fixes the following warning:
# warning: package `project v0.1.0 (/home/runner/work/project/project)` does not have a license
# Ideally 'npm config get init-license' should be used to set the license for new projects
- name: Fix missing license warning
run: |
cd project
jq '.LICENSE = "UNLICENSED"' package.json > fixed-package.json
mv fixed-package.json package.json
# Fixes:
# Error: Unable to read keypair file
# during 'anchor test'
- name: Make a default keypair
run: |
solana-keygen new --no-bip39-passphrase
- name: Fix unused variable warning
run: |
cd project
sed -i 's/ctx/_context/' programs/project/src/lib.rs
# TODO: fixes:
# error: package `solana-program v1.18.11` cannot be built because it requires rustc 1.75.0 or newer, while the currently active rustc version is 1.72.0-dev
# should not be necessary
- name: Fix 'cannot be built' warning
run: |
cd project
cargo add solana-program@"=1.17"
- name: Build and test the project
run: |
cd project
anchor test 2>&1 | tee -a build.log
cat build.log
cat build.log | grep -qEv 'error|warn'