-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (117 loc) · 4.6 KB
/
build.yaml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: build
on:
push:
paths:
- "*.py"
- "**/pyproject.toml"
- "**/*.py"
- .github/workflows/build.yaml
- "**/*.go"
env:
PYTHON_VERSION: "3.11"
POETRY_VERSION: "1.4.2"
jobs:
build-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build everything
run: cd go/src/github.com/broadinstitute/sparklesworker && go build -v ./...
- name: build executable
run: bash scripts/build-static-exe.sh
- name: print md5sum
run: md5sum cli/sparklespray/bin/sparklesworker && ls -s cli/sparklespray/bin/sparklesworker
- name: Upload executable
uses: actions/upload-artifact@v3
with:
name: sparklesworker-exe-${{ github.run_number }}
path: cli/sparklespray/bin/sparklesworker
retention-days: 5
# - name: Test
# run: cd go/src/github.com/broadinstitute/sparklesworker && go test -v ./...
test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
# the following logic for caching taken from https://gist.github.com/gh640/233a6daf68e9e937115371c0ecd39c61
# Poetry cache depends on OS, Python version and Poetry version.
- name: Cache Poetry cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files).
- name: Cache Packages
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Set up poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install dependencies
run: poetry install
working-directory: cli
- name: Run pyratchet
working-directory: cli
run: poetry run pyright-ratchet run pyright
- name: Run tests
run: poetry run pytest
working-directory: cli
build-package:
needs: [test-python, build-go]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
# the following logic for caching taken from https://gist.github.com/gh640/233a6daf68e9e937115371c0ecd39c61
# Poetry cache depends on OS, Python version and Poetry version.
- name: Cache Poetry cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
# virtualenv cache should depends on OS, Python version and `poetry.lock` (and optionally workflow files).
- name: Cache Packages
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Set up poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Download executable
uses: actions/download-artifact@v3
with:
name: sparklesworker-exe-${{ github.run_number }}
path: cli/sparklespray/bin
- name: print md5sum
run: md5sum cli/sparklespray/bin/sparklesworker && ls -s cli/sparklespray/bin/sparklesworker
- name: get package version
run: (echo -n 'package_version=' && poetry version -s) >> "$GITHUB_ENV"
working-directory: cli
- name: Build package
run: poetry build
working-directory: cli
# - name: debug info
# run: find . -print && ls -l dist && ls -l sparkles/bin
# working-directory: cli
- name: Upload sparklespray-${{ env.package_version }}.tar.gz package
uses: actions/upload-artifact@v3
with:
name: sparklespray-${{ env.package_version }}
path: cli/dist/sparklespray-*.tar.gz
retention-days: 5