45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main, develop]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout code
|
|
env:
|
|
CI_TOKEN: ${{ secrets.CI_TOKEN }}
|
|
run: |
|
|
curl -fsSL -H "Authorization: token ${CI_TOKEN}" \
|
|
"http://10.8.0.52:8080/api/v1/repos/andrew/plagin_tokens/archive/main.tar.gz" \
|
|
-o repo.tar.gz
|
|
tar -xzf repo.tar.gz --strip-components=1
|
|
ls
|
|
git init -q && git checkout -b main 2>/dev/null || true
|
|
|
|
- name: Install Bun
|
|
run: |
|
|
apk add --no-cache bash curl unzip
|
|
if ! command -v bun >/dev/null 2>&1; then
|
|
curl -fsSL https://bun.sh/install | bash
|
|
cp -f /root/.bun/bin/bun /usr/local/bin/bun
|
|
fi
|
|
bun --version
|
|
|
|
- name: Install dependencies
|
|
working-directory: plagin_tokens
|
|
run: bun install
|
|
|
|
- name: TypeScript type checking
|
|
working-directory: plagin_tokens
|
|
run: bun run typecheck
|
|
|
|
- name: Run tests
|
|
working-directory: plagin_tokens
|
|
run: bun run test
|