6262 env :
6363 OUT : ${{ steps.get-tag.outputs.sha }}
6464
65+ native_linux :
66+ runs-on : ubuntu-20.04
67+ timeout-minutes : 60
68+ name : Build native Linux ${{ matrix.node-version }} ${{ matrix.target }} Python ${{ matrix.python-version }}
69+ strategy :
70+ matrix :
71+ node-version : [ 16 ]
72+ python-version : [ "fallback" ]
73+ target : [ "x86_64-unknown-linux-gnu" ]
74+ fail-fast : false
75+ container :
76+ image : cubejs/rust-cross:${{ matrix.target }}-30052023
77+
78+ steps :
79+ - name : Checkout
80+ uses : actions/checkout@v4
81+ - name : Install Rust
82+ uses : actions-rs/toolchain@v1
83+ with :
84+ toolchain : nightly-2023-12-13
85+ override : true
86+ components : rustfmt
87+ target : ${{ matrix.target }}
88+ - name : Install Node.js ${{ matrix.node-version }}
89+ uses : actions/setup-node@v3
90+ with :
91+ node-version : ${{ matrix.node-version }}
92+ - name : Install Yarn
93+ run : npm install -g yarn
94+ - name : Set Yarn version
95+ run : yarn policies set-version v1.22.19
96+ - name : Get yarn cache directory path
97+ id : yarn-cache-dir-path
98+ run : echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
99+ shell : bash
100+ - name : Restore yarn cache
101+ uses : actions/cache@v3
102+ with :
103+ path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
104+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
105+ restore-keys : |
106+ ${{ runner.os }}-yarn-
107+ - name : Copy yarn.lock file
108+ run : cp yarn.lock packages/cubejs-docker
109+ - name : Yarn install
110+ uses : nick-invision/retry@v2
111+ env :
112+ CUBESTORE_SKIP_POST_INSTALL : true
113+ with :
114+ max_attempts : 3
115+ retry_on : error
116+ retry_wait_seconds : 15
117+ timeout_minutes : 20
118+ command : yarn install --frozen-lockfile
119+ - name : Compile TypeScript
120+ run : yarn tsc
121+ - name : Build native (fallback)
122+ if : (matrix.python-version == 'fallback')
123+ env :
124+ CARGO_BUILD_TARGET : ${{ matrix.target }}
125+ run : cd packages/cubejs-backend-native && npm run native:build-release
126+ - name : Setup cross compilation
127+ if : (matrix.target == 'aarch64-unknown-linux-gnu')
128+ uses :
allenevans/[email protected] 129+ with :
130+ PYO3_CROSS_PYTHON_VERSION : ${{ matrix.python-version }}
131+ - name : Build native (with Python)
132+ if : (matrix.python-version != 'fallback')
133+ env :
134+ PYO3_PYTHON : python${{ matrix.python-version }}
135+ CARGO_BUILD_TARGET : ${{ matrix.target }}
136+ run : cd packages/cubejs-backend-native && npm run native:build-release-python
137+ - name : Upload native build
138+ uses : actions/upload-artifact@v4
139+ with :
140+ name : backend-native
141+ path : packages/cubejs-backend-native/index.node
142+
65143 build :
66- needs : latest-tag-sha
144+ needs : [ latest-tag-sha, native_linux]
67145 if : (needs['latest-tag-sha'].outputs.sha != github.sha)
68146 runs-on : ubuntu-20.04
69147 timeout-minutes : 30
@@ -81,6 +159,12 @@ jobs:
81159 - name : Set up QEMU
82160 uses : docker/setup-qemu-action@v2
83161
162+ - name : Download native build
163+ uses : actions/download-artifact@v4
164+ with :
165+ name : backend-native
166+ path : packages/cubejs-backend-native/
167+
84168 - name : Set up Docker Buildx
85169 uses : docker/setup-buildx-action@v2
86170 with :
0 commit comments