-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (72 loc) · 1.96 KB
/
build.yaml
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
name: Test & Build
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
contents: read
pull-requests: write
statuses: read
jobs:
lint-and-format:
runs-on: ubuntu-latest
container:
image: node:22
steps:
- uses: actions/checkout@v4
- name: Cache and restore node_modules
id: cache-node
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./yarn.lock') }}
- run: yarn
if: steps.cache-node.outputs.cache-hit != 'true'
- run: yarn lint
- run: yarn format
test:
needs: [ lint-and-format ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start Planka
run: docker compose -f "docker-compose.yml" up -d --build
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- run: yarn
- run: yarn test
- name: Stop Planka
if: always()
run: docker compose -f "docker-compose.yml" down
build:
needs: [ test ]
runs-on: ubuntu-latest
container:
image: node:22
steps:
- uses: actions/checkout@v4
- name: Cache and restore node_modules
id: cache-node
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./yarn.lock') }}
- run: yarn
if: steps.cache-node.outputs.cache-hit != 'true'
- run: yarn build
- name: "Compress out folder"
run: tar -zcvf dist.tar.gz dist/
- name: "Upload /out of build"
uses: actions/upload-artifact@v4
with:
name: build
path: dist.tar.gz
retention-days: 1