Beycan #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and Lint Check | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, edited] | |
branches: | |
- alpha | |
- master | |
jobs: | |
test_and_lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Create .env file | |
run: cp .env.example .env | |
- name: Install dependencies | |
run: | | |
npm install -g pnpm | |
for dir in packages/*/ packages/networks/*/; do | |
if [ -d "$dir" ] && [ "$(basename "$dir")" != "boilerplate" ]; then | |
cd "$dir" || exit | |
pnpm install | |
cd - || exit | |
fi | |
done | |
- name: Run test | |
run: npm run test | |
- name: Runt lint | |
run: npm run lint | |
- name: Set PR status | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
TOKEN="${{ secrets.GITHUB_TOKEN }}" | |
STATUS_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" | |
STATUS="{\"state\":\"success\",\"context\":\"Test Process\",\"description\":\"Test Process passed\"}" | |
curl -X POST -H "Authorization: token $TOKEN" -d "$STATUS" "$STATUS_URL" |