-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (158 loc) · 5.21 KB
/
build.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: .NET (build, test and release if necessary)
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup Python
uses: actions/[email protected]
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Install Souffle
run: brew install --HEAD souffle-lang/souffle/souffle
- name: Build Souffle program
run: |
cd $GITHUB_WORKSPACE/souffle && CXX=clang++ ./build-souffle-macos-x86-64-arm64.sh
- name: Build dotnet
run: |
dotnet build
dotnet test --verbosity normal
- name: Upload ssa-query-macos-x86-64-arm64
# only do it when it hits the default branch
# this artifact is consumed by the release job
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4
with:
name: ssa-query-macos-x86-64-arm64
path: ${{ github.workspace }}/souffle/bin/macos-x86-64-arm64/ssa-query-macos-x86-64-arm64
retention-days: 1
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup Python
uses: actions/[email protected]
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Build dotnet
run: |
dotnet build
dotnet test --verbosity normal
build-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Calculate version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: ${{ github.workspace }}/.github/GitVersion.yml
- name: Setup Python
uses: actions/[email protected]
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.21.x'
- name: Setup dependencies
run: |
sudo ./ci/install-lit.sh
sudo ./ci/install-llvm.sh
sudo ./ci/install-mono.sh
dotnet tool install -g dotnet-repl
- name: Build Souffle programs from scratch
run: |
cd $GITHUB_WORKSPACE/souffle && rm -r bin/ && ./build-all-with-docker.sh
- name: Build dotnet
run: |
dotnet build
dotnet test --verbosity normal
lit integration-test -v
release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: [build-macos, build-windows, build-linux]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Calculate version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: ${{ github.workspace }}/.github/GitVersion.yml
- name: Setup Python
uses: actions/[email protected]
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Build Souffle programs from scratch
run: |
cd $GITHUB_WORKSPACE/souffle && rm -r bin/ && ./build-all-with-docker.sh
- name: Fetch macos binary
uses: actions/download-artifact@v4
with:
name: ssa-query-macos-x86-64-arm64
path: ${{ github.workspace }}/souffle/bin/macos-x86-64-arm64/
- name: Build dotnet
run: |
dotnet build
dotnet test --verbosity normal
- name: Generate nuget packages
run: |
./ci/nuget-pack.sh "${{ steps.gitversion.outputs.AssemblySemVer }}" "${{ steps.gitversion.outputs.AssemblySemVer }}" "${{ steps.gitversion.outputs.InformationalVersion }}" "${{ steps.gitversion.outputs.AssemblySemVer }}" "build/bin/net-ssa/package"
dotnet nuget push build/bin/net-ssa/package/net-ssa-lib.${{ steps.gitversion.outputs.NuGetVersionV2 }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
mirror:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: [build-macos, build-windows, build-linux]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Push to Bitbucket
run: git push "https://${{ secrets.BITBUCKET_MIRROR_USER }}:${{ secrets.BITBUCKET_MIRROR_PASSWORD }}@bitbucket.org/m-carrasco/net-ssa-mirror.git" --all --force