forked from MASQ-Project/Node
-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (130 loc) · 4.45 KB
/
ci-matrix.yml
File metadata and controls
150 lines (130 loc) · 4.45 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: ci-matrix
on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- master
jobs:
generate-dbip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout dbip file from generated-source branch
run: |
git checkout generated-source -- ip_country/src/dbip_country.rs
build:
needs: generate-dbip
if: github.event.pull_request.draft == false
strategy:
fail-fast: true
matrix:
target:
- { name: linux, os: ubuntu-22.04 }
- { name: macos, os: macos-13 }
- { name: windows, os: windows-2022 }
name: Build node on ${{ matrix.target.os }}
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Print source branch name
run: |
echo "Source branch: ${{ github.head_ref }}"
shell: bash
- name: Stable with rustfmt and clippy
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.63.0
components: rustfmt, clippy
override: true
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/cache/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Download dbip file
uses: actions/download-artifact@v4
with:
name: dbip_country
- name: Move and overwrite dbip file
shell: bash
run: cp -f dbip_country.rs ip_country/src/dbip_country.rs || exit 1
- name: Show dbip file
run: cat ip_country/src/dbip_country.rs
- name: Build ${{ matrix.target.os }}
run: |
./ci/all.sh
./ci/multinode_integration_test.sh
./ci/collect_results.sh
shell: bash
- name: Publish ${{ matrix.target.os }}
uses: actions/upload-artifact@v4
with:
name: Node-${{ matrix.target.name }}
path: results
- name: diagnostics
if: failure()
run: |
echo "final disc diagnostics ------>"
df -h /Users/runner/work/Node/Node/node/target/release
deploy_to_s3:
needs: build
if: success() && (startsWith(github.head_ref, 'GH') || startsWith(github.head_ref, 'v'))
strategy:
matrix:
os: [linux, macos, windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- name: Check artifacts exist
run: |
if [ ! -d "Node-${{ matrix.os }}/generated/bin/" ]; then
echo "Error: Build artifacts not found"
exit 1
fi
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- if: startsWith(github.head_ref, 'GH')
name: Versioned S3 Sync
run: |
aws s3 sync "Node-${{ matrix.os }}/generated/bin/" "s3://${{ secrets.AWS_S3_BUCKET }}/Node/${{ github.head_ref }}/Node-${{ matrix.os }}" \
--delete \
--no-progress \
--acl private
- if: startsWith(github.head_ref, 'v')
name: Latest S3 Sync
run: |
aws s3 sync "Node-${{ matrix.os }}/generated/bin/" "s3://${{ secrets.AWS_S3_BUCKET }}/Node/latest/Node-${{ matrix.os }}" \
--delete \
--no-progress \
--acl private
- name: Invalidate Binaries CloudFront
uses: chetan/invalidate-cloudfront-action@v2.4
env:
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
PATHS: "/Node*"
AWS_REGION: "us-west-2"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}