-
Notifications
You must be signed in to change notification settings - Fork 9
122 lines (106 loc) · 3.16 KB
/
ci.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node: ['18', '20', '21', '22']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm ci --omit=dev
- run: npm ci
- run: npm run test:types
- run: npm run test:lint
if: matrix.os != 'windows-latest'
- run: npm run test:unit
test-locales:
runs-on: ubuntu-latest
strategy:
matrix:
lang:
- en_GB.UTF-8
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npm run test:unit
env:
LANG: ${{ matrix.lang }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
name: Build and test Docker
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
env:
REGISTRY: ghcr.io
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: "arm64"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and load Docker image
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: core-test
cache-from: type=registry,ref=ghcr.io/filecoin-station/core
cache-to: type=inline
- name: Build Docker image for other platforms
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64
cache-from: type=registry,ref=ghcr.io/filecoin-station/core
cache-to: type=inline
- name: Start Station Core container with PASSPHRASE
run: |
docker run \
--name station \
--detach \
--env FIL_WALLET_ADDRESS=0x000000000000000000000000000000000000dEaD \
--env PASSPHRASE=secret \
$IMAGEID
env:
IMAGEID: ${{ steps.docker_build.outputs.imageid }}
- name: Print station activity
run: |
sleep 10 # Wait for Station modules to start
docker logs station
- name: Check | Spark started
run: docker logs station | grep "Spark started"
- name: Start Station Core container without PASSPHRASE
run: |
docker run \
--name station_unsecure \
--detach \
--env FIL_WALLET_ADDRESS=0x000000000000000000000000000000000000dEaD \
$IMAGEID
env:
IMAGEID: ${{ steps.docker_build.outputs.imageid }}
- name: Print station activity
run: |
sleep 10 # Wait for Station modules to start
docker logs station_unsecure
- name: Check | Spark started
run: docker logs station_unsecure | grep "Spark started"