|
1 |
| -name: Continuous Integration |
| 1 | +name: "Editor: CI & Dev" |
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - master |
7 |
| - pull_request: |
8 |
| - branches: |
9 |
| - - master |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
10 | 10 | env:
|
11 |
| - CARGO_TERM_COLOR: always |
12 |
| - INDEX_HTML_HEAD_REPLACEMENT: <script defer data-domain="dev.graphite.rs" data-api="https://graphite.rs/visit/event" src="https://graphite.rs/visit/script.outbound-links.file-downloads.js"></script> |
| 11 | + CARGO_TERM_COLOR: always |
| 12 | + INDEX_HTML_HEAD_REPLACEMENT: <script defer data-domain="dev.graphite.rs" data-api="https://graphite.rs/visit/event" src="https://graphite.rs/visit/script.outbound-links.file-downloads.js"></script> |
13 | 13 |
|
14 | 14 | jobs:
|
15 |
| - build: |
16 |
| - runs-on: self-hosted |
17 |
| - permissions: |
18 |
| - contents: read |
19 |
| - deployments: write |
20 |
| - pull-requests: write |
21 |
| - env: |
22 |
| - RUSTC_WRAPPER: /usr/bin/sccache |
23 |
| - CARGO_INCREMENTAL: 0 |
24 |
| - SCCACHE_DIR: /var/lib/github-actions/.cache |
25 |
| - |
26 |
| - steps: |
27 |
| - - uses: actions/checkout@v3 |
28 |
| - |
29 |
| - - name: 🔧 Clear wasm-bindgen cache |
30 |
| - run: rm -r ~/.cache/.wasm-pack |
31 |
| - |
32 |
| - - name: 🔧 Set up Node |
33 |
| - uses: actions/setup-node@v3 |
34 |
| - with: |
35 |
| - node-version: '16' |
36 |
| - |
37 |
| - - name: 🚧 Install Node dependencies |
38 |
| - run: | |
39 |
| - cd frontend |
40 |
| - npm ci |
41 |
| -
|
42 |
| - - name: 🔼 Update Rust to latest stable |
43 |
| - run: | |
44 |
| - rustc --version |
45 |
| - rustup update stable |
46 |
| - rustc --version |
47 |
| -
|
48 |
| - - name: Replace template in <head> of index.html |
49 |
| - run: | |
50 |
| - # Remove the INDEX_HTML_HEAD_REPLACEMENT environment variable for build links (not master deploys) |
51 |
| - git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_REPLACEMENT="" |
52 |
| - sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html |
53 |
| -
|
54 |
| - - name: 🌐 Build Graphite web code |
55 |
| - env: |
56 |
| - NODE_ENV: production |
57 |
| - run: | |
58 |
| - cd frontend |
59 |
| - mold -run npm run build |
60 |
| -
|
61 |
| - - name: Publish |
62 |
| - id: cloudflare |
63 |
| - uses: cloudflare/pages-action@1 |
64 |
| - continue-on-error: true |
65 |
| - with: |
66 |
| - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
67 |
| - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |
68 |
| - projectName: graphite-dev |
69 |
| - directory: frontend/dist |
70 |
| - gitHubToken: ${{ secrets.GITHUB_TOKEN }} |
71 |
| - |
72 |
| - - name: 👕 Lint Graphite web formatting |
73 |
| - env: |
74 |
| - NODE_ENV: production |
75 |
| - run: | |
76 |
| - cd frontend |
77 |
| - # npm run lint |
78 |
| - echo "💥 Frontend linting is temporarily disabled until it can be set up again with Svelte 💥" |
79 |
| -
|
80 |
| - - name: 🔬 Check Rust formatting |
81 |
| - run: | |
82 |
| - mold -run cargo fmt --all -- --check |
83 |
| -
|
84 |
| - - name: 🦀 Build Rust code |
85 |
| - run: | |
86 |
| - mold -run cargo build |
87 |
| -
|
88 |
| - - name: 🧪 Run Rust tests |
89 |
| - run: | |
90 |
| - mold -run cargo nextest run |
91 |
| -
|
92 |
| - #miri: |
93 |
| - # runs-on: self-hosted |
94 |
| - # |
95 |
| - # steps: |
96 |
| - # - uses: actions/checkout@v3 |
97 |
| - # |
98 |
| - # - name: 🧪 Run Rust miri |
99 |
| - # run: | |
100 |
| - # mold -run cargo +nightly miri nextest run -j32 |
101 |
| -
|
102 |
| - cargo-deny: |
103 |
| - runs-on: ubuntu-latest |
104 |
| - |
105 |
| - strategy: |
106 |
| - matrix: |
107 |
| - checks: |
108 |
| - - 'crate security advisories' |
109 |
| - - 'crate license compatibility' |
110 |
| - |
111 |
| - # Prevent sudden announcement of a new advisory from failing ci: |
112 |
| - continue-on-error: ${{ matrix.checks == 'crate security advisories' }} |
113 |
| - |
114 |
| - steps: |
115 |
| - - uses: actions/checkout@v3 |
116 |
| - |
117 |
| - - uses: EmbarkStudios/cargo-deny-action@v1 |
118 |
| - if: matrix.checks == 'crate security advisories' |
119 |
| - with: |
120 |
| - command: check advisories |
121 |
| - |
122 |
| - - uses: EmbarkStudios/cargo-deny-action@v1 |
123 |
| - if: matrix.checks == 'crate license compatibility' |
124 |
| - with: |
125 |
| - command: check bans licenses sources |
| 15 | + build: |
| 16 | + runs-on: self-hosted |
| 17 | + permissions: |
| 18 | + contents: read |
| 19 | + deployments: write |
| 20 | + pull-requests: write |
| 21 | + env: |
| 22 | + RUSTC_WRAPPER: /usr/bin/sccache |
| 23 | + CARGO_INCREMENTAL: 0 |
| 24 | + SCCACHE_DIR: /var/lib/github-actions/.cache |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v3 |
| 28 | + |
| 29 | + - name: 🔧 Clear wasm-bindgen cache |
| 30 | + run: rm -r ~/.cache/.wasm-pack |
| 31 | + |
| 32 | + - name: 🔧 Set up Node |
| 33 | + uses: actions/setup-node@v3 |
| 34 | + with: |
| 35 | + node-version: "16" |
| 36 | + |
| 37 | + - name: 🚧 Install Node dependencies |
| 38 | + run: | |
| 39 | + cd frontend |
| 40 | + npm ci |
| 41 | +
|
| 42 | + - name: 🔼 Update Rust to latest stable |
| 43 | + run: | |
| 44 | + rustc --version |
| 45 | + rustup update stable |
| 46 | + rustc --version |
| 47 | +
|
| 48 | + - name: Replace template in <head> of index.html |
| 49 | + run: | |
| 50 | + # Remove the INDEX_HTML_HEAD_REPLACEMENT environment variable for build links (not master deploys) |
| 51 | + git rev-parse --abbrev-ref HEAD | grep master > /dev/null || export INDEX_HTML_HEAD_REPLACEMENT="" |
| 52 | + sed -i "s|<!-- INDEX_HTML_HEAD_REPLACEMENT -->|$INDEX_HTML_HEAD_REPLACEMENT|" frontend/index.html |
| 53 | +
|
| 54 | + - name: 🌐 Build Graphite web code |
| 55 | + env: |
| 56 | + NODE_ENV: production |
| 57 | + run: | |
| 58 | + cd frontend |
| 59 | + mold -run npm run build |
| 60 | +
|
| 61 | + - name: Publish |
| 62 | + id: cloudflare |
| 63 | + uses: cloudflare/pages-action@1 |
| 64 | + continue-on-error: true |
| 65 | + with: |
| 66 | + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
| 67 | + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |
| 68 | + projectName: graphite-dev |
| 69 | + directory: frontend/dist |
| 70 | + gitHubToken: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + |
| 72 | + - name: 👕 Lint Graphite web formatting |
| 73 | + env: |
| 74 | + NODE_ENV: production |
| 75 | + run: | |
| 76 | + cd frontend |
| 77 | + # npm run lint |
| 78 | + echo "💥 Frontend linting is temporarily disabled until it can be set up again with Svelte 💥" |
| 79 | +
|
| 80 | + - name: 🔬 Check Rust formatting |
| 81 | + run: | |
| 82 | + mold -run cargo fmt --all -- --check |
| 83 | +
|
| 84 | + - name: 🦀 Build Rust code |
| 85 | + run: | |
| 86 | + mold -run cargo build |
| 87 | +
|
| 88 | + - name: 🧪 Run Rust tests |
| 89 | + run: | |
| 90 | + mold -run cargo nextest run |
| 91 | +
|
| 92 | + #miri: |
| 93 | + # runs-on: self-hosted |
| 94 | + # |
| 95 | + # steps: |
| 96 | + # - uses: actions/checkout@v3 |
| 97 | + # |
| 98 | + # - name: 🧪 Run Rust miri |
| 99 | + # run: | |
| 100 | + # mold -run cargo +nightly miri nextest run -j32 |
| 101 | +
|
| 102 | + cargo-deny: |
| 103 | + runs-on: ubuntu-latest |
| 104 | + |
| 105 | + strategy: |
| 106 | + matrix: |
| 107 | + checks: |
| 108 | + - "crate security advisories" |
| 109 | + - "crate license compatibility" |
| 110 | + |
| 111 | + # Prevent sudden announcement of a new advisory from failing ci: |
| 112 | + continue-on-error: ${{ matrix.checks == 'crate security advisories' }} |
| 113 | + |
| 114 | + steps: |
| 115 | + - uses: actions/checkout@v3 |
| 116 | + |
| 117 | + - uses: EmbarkStudios/cargo-deny-action@v1 |
| 118 | + if: matrix.checks == 'crate security advisories' |
| 119 | + with: |
| 120 | + command: check advisories |
| 121 | + |
| 122 | + - uses: EmbarkStudios/cargo-deny-action@v1 |
| 123 | + if: matrix.checks == 'crate license compatibility' |
| 124 | + with: |
| 125 | + command: check bans licenses sources |
0 commit comments