-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (89 loc) · 2.45 KB
/
rust.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
name: build
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
EXECUTABLE_NAME: fractal-explorer-app
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check formatting
run: cargo fmt -- --check
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
windows-executable:
name: Windows executable
needs: build
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Executable
run: |
cargo build --release
- uses: actions/upload-artifact@v3
with:
name: windows-executable
path: |
target/release/${{ env.EXECUTABLE_NAME }}.exe
macos-executable:
name: macOS executable
needs: build
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Executable
run: |
cargo build --release
- uses: actions/upload-artifact@v3
with:
name: macos-executable
path: |
target/release/${{ env.EXECUTABLE_NAME }}
web-assembly:
name: WebAssembly build
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install wasm-pack
run: cargo install wasm-pack
- name: WASM build
run: wasm-pack build --target web --out-dir public/pkg
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: web-assembly-build
path: public/
- name: Setup Pages
uses: actions/configure-pages@v1
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: public/
deploy: # https://github.com/actions/deploy-pages
name: GitHub Pages deployment
needs: web-assembly
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1