forked from Txio-labs/txio
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (94 loc) · 3.1 KB
/
Copy pathci.yml
File metadata and controls
113 lines (94 loc) · 3.1 KB
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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
lint:
name: Lint Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint -w txio-frontend
test:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Test
run: npm test -w txio-frontend
rust:
name: Rust Backend & CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@1.88.0
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: cargo fmt --check
run: cargo fmt --all --check
- name: cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: cargo build
run: cargo build --workspace
- name: cargo test
run: cargo test --workspace
build:
name: Build Apps
needs: [lint, test, rust]
if: ${{ always() && needs.lint.result == 'success' && needs.test.result == 'success' && needs.rust.result == 'success' }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '20.x'
cache: 'npm'
- name: Install Linux Build Dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends fakeroot dpkg lintian fuse libfuse2
- name: Install dependencies
run: npm install
- name: Build frontend
run: npm run build --workspace frontend
- name: Prepare desktop assets
run: node scripts/copy-frontend-out.mjs
- name: Build desktop app
run: npm run build --workspace desktop -- --publish=never
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: txio-dist-${{ matrix.os }}
path: desktop/dist/
retention-days: 7