-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (152 loc) · 5.1 KB
/
mac_os.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
# Copilot generated GitHub Actions workflow for macOS
# Thank you Bing's Copilot!
name: Rust Tests, Build, and Release
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
mac-test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install LLVM tools
run: brew install llvm
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Run tests with coverage
run: cargo llvm-cov --workspace --lcov --output-path ./target/lcov.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
mac-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install cargo bundle
run: cargo install cargo-bundle
- name: Build macOS binary
run: cargo bundle --release --features "gui openai drama_llama"
mac-release:
needs: [mac-test, mac-build]
runs-on: macos-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Create macOS release bundle
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false
- name: Upload macOS release bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/release/bundle/osx/Weave.app
asset_name: Weave.app
asset_content_type: application/octet-stream
linux-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install LLVM tools
run: sudo apt-get install llvm
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Run tests with coverage
run: cargo llvm-cov --workspace --lcov --output-path ./target/lcov.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
linux-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install cargo bundle
run: cargo install cargo-bundle
- name: Build Linux binary
run: cargo bundle --release --features "gui openai drama_llama"
linux-release:
needs: [linux-test, linux-build]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Create Linux release bundle
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false
- name: Upload Linux release bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/release/bundle/linux/Weave
asset_name: Weave
asset_content_type: application/octet-stream
windows-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install LLVM tools
run: choco install llvm
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Run tests with coverage
run: cargo llvm-cov --workspace --lcov --output-path ./target/lcov.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install cargo bundle
run: cargo install cargo-bundle
- name: Build Windows binary
run: cargo bundle --release --features "gui openai drama_llama"
windows-release:
needs: [windows-test, windows-build]
runs-on: windows-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Create Windows release bundle
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false
- name: Upload Windows release bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/release/bundle/windows/Weave.exe
asset_name: Weave.exe
asset_content_type: application/octet-stream