-
Notifications
You must be signed in to change notification settings - Fork 17
94 lines (82 loc) · 2.91 KB
/
preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Preview
on:
pull_request_target:
branches: [ main ]
permissions:
contents: read
statuses: write
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
jobs:
vercel:
runs-on: ubuntu-latest
environment: vercel-deployment
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install scipy numpy
flit install --symlink
git clone https://github.com/stsewd/tree-sitter-rst
cd tree-sitter-rst
git checkout 3fc88d2097bc854ab6bf70c52b3c482849cf8e8f
cd -
papyri build-parser
- name: Gen numpy
run: |
papyri gen examples/numpy.toml --no-exec --no-infer --no-narrative
sleep 1 # time for coverage to write its stuff
- name: Gen Scipy
run: |
papyri gen examples/scipy.toml --no-exec --no-infer
sleep 1 # time for coverage to write its stuff
- name: Self gen
run: |
papyri gen examples/papyri.toml --exec --no-narrative
sleep 1 # time for coverage to write its stuff
- name: Ingest and Render
run: |
papyri ingest --no-relink ~/.papyri/data/papyri_0.0.8
papyri ingest --no-relink ~/.papyri/data/*
papyri relink
papyri render
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Unique Deploy ID
id: deploy
run: |
echo "DEPLOY_ID=${{ github.event.pull_request.head.sha }}--${{ github.run_id }}" >> "$GITHUB_OUTPUT"
- name: Deploy Project Artifacts to Vercel
id: vercel
working-directory: "/home/runner/.papyri/html"
run: |
vercel --version
vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
vercel build --token=$VERCEL_TOKEN
vercel deploy --prebuilt --archive=tgz --token=$VERCEL_TOKEN --meta commit=${{ steps.deploy.outputs.DEPLOY_ID }}
vercel ls --token=$VERCEL_TOKEN --meta commit=${{ steps.deploy.outputs.DEPLOY_ID }} &> vercel-output
url=$(cat vercel-output | grep http | awk '{print $2}')
echo "VERCEL_URL=$url" >> "$GITHUB_OUTPUT"
- name: Update PR status with Deployment URL
uses: Sibz/github-status-action@v1
with:
authToken: ${{ github.token }}
context: 'Vercel Deployment Preview'
description: 'Deployed'
state: 'success'
target_url: ${{ steps.vercel.outputs.VERCEL_URL }}
sha: ${{ github.event.pull_request.head.sha || github.sha }}