-
Notifications
You must be signed in to change notification settings - Fork 8
109 lines (95 loc) · 3.23 KB
/
pull_request.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Pull Request
# Runs the build and test scripts on PR
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: 🧪 Build and Test
runs-on: ${{ matrix.os }}
# Run action for [home/clinic] with in [windows/macOS/ubuntu]
strategy:
matrix:
setting: [home, clinic]
os: [windows-latest, macOS-latest, ubuntu-latest]
fail-fast: false # A failed build will not end the other matrix jobs
steps:
# Set up runner
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: 🐍 Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
# # Install dependencies and set up environment
# - name: 📥 Install Dependencies
# run: npm ci
# - name: 🔃 Load .env file (.env.${{matrix.setting}})
# uses: xom9ikk/dotenv@v2
# with:
# path: ./env
# mode: ${{matrix.setting}}
# # Test and lint
# - name: 🧪 Test
# run: npm test
# env:
# CI: true
# - name: 🔬 Lint
# run: npm run lint -- --max-warnings=0
# # Build the app
# - name: ⚒ Build
# run: npm run build
# TEMP - TEST ACTION ON PR
package-psiturk:
name: Package for PsiTurk
runs-on: ubuntu-latest
steps:
# Set up runner
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: 🐍 Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
# Install dependencies
- name: 📥 Install Dependencies
run: npm ci
- name: 📥 Install PsiTurk
run: pip install psiturk
# Build the app
- name: ⚒ Build
run: npm run build
# Get package info
- name: Get package name and version
id: package_info
run: |
echo "name=$(cat package.json | jq -r '.name')" >> $GITHUB_OUTPUT
echo "version=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT
# Package with PsiTurk
- name: 📦 Create Psiturk Build
run: |
cd psiturkit
./psiturk-it -p ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-psiturk
- name: ⬆ Upload PsiTurk Build
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-psiturk
# path: psiturkit/${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-psiturk
# if-no-files-found: error
uses: svenstaro/upload-release-action@v2
with:
file: psiturkit/${{ steps.package_info.outputs.name }}-psiturk.zip
asset_name: ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}-psiturk
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}