repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

.github/workflows/check.yml

Raw
File outline
name: check

on:
  push:
  pull_request_target:

permissions:
  contents: read

jobs:
  extensions:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        env:
          CHECKOUT_REPO: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.repository }}
          CHECKOUT_REF: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
        run: |
          git init .
          git remote add origin "https://github.com/${CHECKOUT_REPO}.git"
          git fetch --depth=1 origin "$CHECKOUT_REF"
          git checkout --detach FETCH_HEAD
      - name: Install Bun
        run: |
          curl -fsSL -o bun.zip https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-linux-x64.zip
          unzip -q bun.zip
          echo "$PWD/bun-linux-x64" >> "$GITHUB_PATH"
          "$PWD/bun-linux-x64/bun" --version
      - name: Install Nushell
        run: |
          curl -fsSL -o nu.tar.gz https://github.com/nushell/nushell/releases/download/0.112.2/nu-0.112.2-x86_64-unknown-linux-gnu.tar.gz
          tar -xzf nu.tar.gz
          echo "$PWD/nu-0.112.2-x86_64-unknown-linux-gnu" >> "$GITHUB_PATH"
          "$PWD/nu-0.112.2-x86_64-unknown-linux-gnu/nu" --version
      - name: Check extensions
        run: python3 scripts/extensions.py check
      - name: Test extensions
        run: python3 scripts/extensions.py test