-
Notifications
You must be signed in to change notification settings - Fork 15
79 lines (64 loc) · 2.15 KB
/
build.yml
File metadata and controls
79 lines (64 loc) · 2.15 KB
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
name: Build and test the extension
on:
pull_request:
branches: [ master ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {} # Deny all permissions by default at workflow level
jobs:
test-build:
runs-on: ubuntu-latest
steps:
# 1 – Check out the code
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
# 2 – Expose the version tag as $PACKAGE_VERSION (only if this is a v* tag ref)
- name: Set environment package version from tag
shell: bash
run: |
ref="${GITHUB_REF#refs/*/}"
if [[ "$ref" == v* ]]; then
echo "PACKAGE_VERSION=${ref#v}" >> "$GITHUB_ENV"
else
echo "PACKAGE_VERSION=" >> "$GITHUB_ENV"
fi
# 3 – Set up Python
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'
cache: 'pip'
# 4 – Set up Node.js
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24.x'
cache: 'npm'
# 5 – Set up JDK 17 and enable sbt cache
- name: Set up JDK 17
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '17'
cache: 'sbt'
# 6 – Install sbt 1.12.4
- name: Set up sbt
uses: sbt/setup-sbt@508b753e53cb6095967669e0911487d2b9bc9f41 # v1.1.22
with:
sbt-runner-version: '1.12.4'
# 7 – Install Python build / publish deps
- name: Install Python dependencies
run: python -m pip install --upgrade pip build twine
# 8 – Build the wheel
- name: Build wheel
run: python -m build
# 9 – Install the package
- name: Install the package
run: pip install .
# 10 – Install pytest
- name: Install pytest
run: pip install pytest
# 11 – Run tests
- name: Run tests
run: pytest