build: Bump @types/node from 18.16.19 to 20.12.12 #2390
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
concurrency: | |
group: ${{ github.ref }}-ci | |
cancel-in-progress: true | |
jobs: | |
windows-build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: volta-cli/action@v4 | |
# This is required cause the endpoint tauri is using to download MicrosoftEdgeWebView2RuntimeInstallerX64.exe | |
# is not working. | |
- name: Install dependencies | |
run: | | |
$URL="https://static-website20200704084657677400000001.s3.eu-west-1.amazonaws.com/MicrosoftEdgeWebView2RuntimeInstallerX64.exe" | |
$Path="$env:LOCALAPPDATA\tauri\Webview2OfflineInstaller\aa5fd9b3-dc11-4cbc-8343-a50f57b311e1\x64\MicrosoftEdgeWebView2RuntimeInstaller.exe" | |
New-Item -Path "$env:LOCALAPPDATA\tauri\Webview2OfflineInstaller\aa5fd9b3-dc11-4cbc-8343-a50f57b311e1\x64\" -ItemType Directory | |
Invoke-WebRequest -URI $URL -OutFile $Path | |
- name: Restore npm cache | |
uses: actions/cache/restore@v4 | |
id: restore-npm-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v1 | |
- name: Install npm dependencies | |
run: | | |
npm install -g yarn | |
yarn install --network-timeout 100000 | |
- name: Restore cargo cache | |
uses: actions/cache/restore@v4 | |
id: restore-cargo-cache | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
backend/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1 | |
- name: Test | |
run: | | |
mkdir frontend/dist | |
yarn test | |
- name: Bundle | |
run: yarn tauri build -b msi | |
- name: Build release artifact | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
# clean up cached bundle | |
yarn rimraf backend/target/release/bundle/ | |
# build | |
yarn tauri build | |
env: | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
GRAPHITE_TOKEN: ${{ secrets.GRAPHITE_TOKEN }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows-artifacts | |
path: backend/target/release/bundle/* | |
retention-days: 1 | |
- name: Update manifest | |
run: | | |
python ./scripts/update-manifest.py --target windows | |
# remove unused manifests | |
rm manifests/update-linux.json | |
rm manifests/update-darwin.json | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
manifests/update-windows.json | |
backend/target/release/Insulator*.exe | |
backend/target/release/bundle/msi/Insulator*.msi | |
backend/target/release/bundle/msi/Insulator*.msi.zip | |
- name: Save npm cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: "**/node_modules" | |
key: ${{ steps.restore-npm-cache.outputs.cache-primary-key }} | |
- name: Save cargo cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
backend/target/ | |
key: ${{ steps.restore-cargo-cache.outputs.cache-primary-key }} | |
macos-build: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: volta-cli/action@v4 | |
- name: Restore npm cache | |
uses: actions/cache/restore@v4 | |
id: restore-npm-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v1 | |
- name: Install npm dependencies | |
run: | | |
npm install -g yarn | |
yarn install --network-timeout 100000 | |
- name: Restore cargo cache | |
uses: actions/cache/restore@v4 | |
id: restore-cargo-cache | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
backend/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1 | |
- name: Setup docker (missing on MacOS) | |
run: | | |
brew install docker | |
colima start | |
# For testcontainers to find the Colima socket | |
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running | |
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock | |
- name: Install tarpaulin | |
run: cargo install cargo-tarpaulin || true | |
- name: Run test Kafka cluster | |
run: | | |
docker run -d --name=redpanda-1 --rm \ | |
-p 8081:8081 \ | |
-p 9092:9092 \ | |
-p 9644:9644 \ | |
docker.vectorized.io/vectorized/redpanda:latest \ | |
redpanda start \ | |
--overprovisioned \ | |
--smp 1 \ | |
--memory 1G \ | |
--reserve-memory 0M \ | |
--node-id 0 \ | |
--check=false | |
- name: Tests and coverage | |
run: | | |
mkdir frontend/dist | |
yarn lint:check | |
# run unit and integration tests | |
yarn coverage | |
# upload coverage | |
bash <(curl -s https://codecov.io/bash) | |
# - name: Test | |
# run: | | |
# # clean up cached bundle | |
# yarn rimraf backend/target/release/bundle/ | |
# mkdir frontend/dist | |
# yarn test | |
- name: Bundle | |
run: yarn tauri build -b dmg | |
- name: Build release artifact | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
# clean up cached bundle | |
yarn rimraf backend/target/release/bundle/ | |
# build | |
yarn tauri build | |
env: | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
GRAPHITE_TOKEN: ${{ secrets.GRAPHITE_TOKEN }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: mac-os-artifacts | |
path: backend/target/release/bundle/* | |
retention-days: 1 | |
- name: Update manifest | |
run: | | |
python3 ./scripts/update-manifest.py --target darwin | |
# remove unused manifests | |
rm manifests/update-linux.json manifests/update-windows.json | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
manifests/update-darwin.json | |
backend/target/release/bundle/dmg/*.dmg | |
backend/target/release/bundle/macos/Insulator*.app.tar.gz | |
- name: Save npm cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: "**/node_modules" | |
key: ${{ steps.restore-npm-cache.outputs.cache-primary-key }} | |
- name: Save cargo cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
backend/target/ | |
key: ${{ steps.restore-cargo-cache.outputs.cache-primary-key }} | |
ubuntu-build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: volta-cli/action@v4 | |
- name: Restore npm cache | |
uses: actions/cache/restore@v4 | |
id: restore-npm-cache | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-v1 | |
- name: Install npm dependencies | |
run: | | |
npm install -g yarn | |
yarn install --network-timeout 100000 | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt update -y | |
sudo apt install -y libwebkit2gtk-4.0-dev libdbus-1-dev pkg-config libgtk-3-dev libsoup2.4-dev \ | |
build-essential curl wget libsasl2-dev libayatana-appindicator3-dev librsvg2-dev | |
- name: Restore cargo cache | |
uses: actions/cache/restore@v4 | |
id: restore-cargo-cache | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
backend/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1 | |
- name: Install tarpaulin | |
run: cargo install cargo-tarpaulin || true | |
- name: Run test Kafka cluster | |
run: | | |
docker run -d --name=redpanda-1 --rm \ | |
-p 8081:8081 \ | |
-p 9092:9092 \ | |
-p 9644:9644 \ | |
docker.vectorized.io/vectorized/redpanda:latest \ | |
redpanda start \ | |
--overprovisioned \ | |
--smp 1 \ | |
--memory 1G \ | |
--reserve-memory 0M \ | |
--node-id 0 \ | |
--check=false | |
- name: Tests and coverage | |
run: | | |
mkdir frontend/dist | |
yarn lint:check | |
# run unit and integration tests | |
yarn coverage | |
# upload coverage | |
bash <(curl -s https://codecov.io/bash) | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Bundle | |
run: yarn tauri build -b deb appimage | |
- name: Build release artifact | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
# clean up cached bundle | |
yarn rimraf backend/target/release/bundle/ | |
# build | |
yarn tauri build | |
env: | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
GRAPHITE_TOKEN: ${{ secrets.GRAPHITE_TOKEN }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ubuntu-artifacts | |
path: backend/target/release/bundle/* | |
retention-days: 1 | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
manifests/update-linux.json | |
backend/target/release/bundle/deb/insulator-*_amd64.deb | |
backend/target/release/bundle/appimage/insulator-*_amd64.AppImage | |
backend/target/release/bundle/appimage/insulator-*_amd64.AppImage.tar.gz | |
- name: Save npm cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: "**/node_modules" | |
key: ${{ steps.restore-npm-cache.outputs.cache-primary-key }} | |
- name: Save cargo cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
backend/target/ | |
key: ${{ steps.restore-cargo-cache.outputs.cache-primary-key }} |