Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Cache some deps #2190

Merged
merged 20 commits into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 37 additions & 41 deletions .github/workflows/atomicdex-desktop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@ jobs:
host: 'windows'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: 'true'

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.4.1
uses: ilammy/msvc-dev-cmd@v1.12.0

- name: Build libwally (Windows)
if: runner.os == 'Windows'
Expand All @@ -107,64 +107,54 @@ jobs:

- name: Install QT (macOS)
if: runner.os == 'macOS'
uses: KomodoPlatform/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3.0.0
with:
version: ${{ matrix.qt }}
setup-python: 'false'
host: ${{ matrix.host }}
target: 'desktop'
dir: '${{ github.workspace }}'
modules: 'qtcharts qtwidgets debug_info qtwebengine qtwebview'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
tools: 'tools_ifw'
setup-python: 'false'
cache: true

- name: Install QT (Linux)
if: runner.os == 'Linux'
uses: KomodoPlatform/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3.0.0
with:
version: ${{ matrix.qt }}
setup-python: 'false'
host: ${{ matrix.host }}
target: 'desktop'
dir: '${{ github.workspace }}'
modules: 'qtcharts qtwidgets debug_info qtwebengine qtwebview'
aqtversion: '==0.8'
py7zrversion: '==0.6'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
setup-python: 'false'
cache: true

- name: Install QT (Windows)
if: runner.os == 'Windows'
uses: KomodoPlatform/install-qt-action@v2.14.0
uses: jurplel/install-qt-action@v3.0.0
with:
version: ${{ matrix.qt }}
host: ${{ matrix.host }}
dir: 'C:\'
target: 'desktop'
modules: 'qtcharts debug_info qtwebengine'
tools: 'tools_ifw'
arch: 'win64_msvc2019_64'
dir: 'C:\'
modules: 'qtcharts qtwidgets debug_info qtwebview qtwebengine'

- name: Install QT IFW (MacOS)
if: runner.os == 'macOS'
run: |
python3 -m aqt tool ${{ matrix.host }} tools_ifw 4.5.1 qt.tools.ifw.45 --outputdir ${{ github.workspace }}/Qt
echo "${{ github.workspace }}/Qt/Tools/QtInstallerFramework/4.5/bin" >> $GITHUB_PATH

- name: Install QT IFW (Windows)
if: runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
python -m aqt tool ${{ matrix.host }} tools_ifw 4.5.1 qt.tools.ifw.45 --outputdir C:/Qt
echo "C:/Qt/Tools/QtInstallerFramework/4.5/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
cache: true

- name: Install nim (Linux)
if: runner.os == 'Linux'
run: |
export DEBIAN_FRONTEND=noninteractive
export SHELL=/bin/bash
echo "CHOOSENIM_CHOOSE_VERSION=1.4.8" >> $GITHUB_ENV
export CHOOSENIM_CHOOSE_VERSION=1.4.8
echo "CHOOSENIM_CHOOSE_VERSION=1.6.10" >> $GITHUB_ENV
export CHOOSENIM_CHOOSE_VERSION=1.6.10
curl https://nim-lang.org/choosenim/init.sh > choosenim.sh
chmod +x choosenim.sh
./choosenim.sh -y
export PATH=/home/runner/.nimble/bin:$PATH
chmod +x /home/runner/.choosenim/toolchains/nim-1.4.8/bin/*
chmod +x /home/runner/.choosenim/toolchains/nim-1.6.10/bin/*

- name: Install deps (Linux)
if: runner.os == 'Linux'
Expand All @@ -191,11 +181,11 @@ jobs:
echo "CC=clang-12" >> $GITHUB_ENV

- name: vcpkg deps (All)
uses: KomodoPlatform/run-vcpkg@v7
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo'
setupOnly: true
appendedCacheKey: ${{ hashFiles('vcpkg.json') }}
vcpkgJsonGlob: 'vcpkg.json'


- name: import code signing certificates (macos)
Expand All @@ -222,6 +212,11 @@ jobs:
- name: Build AtomicDEX (MacOS)
if: runner.os == 'macOS'
run: |
xcrun --sdk macosx --show-sdk-path
export SDK_PATH=$(xcrun --sdk macosx --show-sdk-path)
ls /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
echo $HOME/sdk
ls $HOME/sdk
export MAC_SIGN_IDENTITY="${{ secrets.MAC_SIGN_IDENTITY }}"
export INSTALLER_MAC_SIGN_IDENTITY="${{ secrets.INSTALLER_MAC_SIGN_IDENTITY }}"
export APPLE_ATOMICDEX_PASSWORD="${{ secrets.APPLE_ATOMICDEX_PASSWORD }}"
Expand All @@ -237,6 +232,7 @@ jobs:
./ci_tools_atomic_dex bundle ${{ matrix.type }} --osx_sdk=$HOME/sdk/MacOSX10.15.sdk --compiler=clang++



- name: Build AtomicDEX (Linux)
if: runner.os == 'Linux'
run: |
Expand Down Expand Up @@ -276,23 +272,23 @@ jobs:

- name: Upload bundle artifact (Linux ZSTD)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zstd }}
path: ./bundled/linux/${{ env.target_name_zstd }}
retention-days: 7

- name: Upload bundle artifact (Linux ZIP)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zip }}
path: ./bundled/linux/${{ env.target_name_zip }}
retention-days: 7

- name: Upload bundle artifact (Linux AppImage)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_appimage }}
path: ./bundled/linux/${{ env.target_name_appimage }}
Expand All @@ -306,15 +302,15 @@ jobs:

- name: Upload artifacts (MacOS dmg)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_dmg }}
path: ./bundled/osx/${{ env.DEX_PROJECT_NAME }}.dmg
retention-days: 7

- name: Upload artifacts (MacOS installer)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_installer }}
path: ./bundled/osx/${{ env.DEX_PROJECT_NAME }}_installer.7z
Expand All @@ -329,15 +325,15 @@ jobs:

- name: Upload artifacts (Windows zip)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_zip }}
path: ./bundled/windows/bin.zip
retention-days: 7

- name: Upload artifacts (Windows installer)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name_installer }}
path: ./bundled/windows/${{ env.DEX_PROJECT_NAME }}_installer.exe
Expand Down
5 changes: 1 addition & 4 deletions ci_tools_atomic_dex/ci_scripts/osx_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

brew update

brew tap-new $USER/local-nim
brew extract --version=1.4.8 nim $USER/local-nim

brew unlink libtool
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/0fbd6e24c4122e18ade1ec6c5916cb21de14f352/Formula/libtool.rb
brew install libtool.rb
Expand All @@ -13,7 +10,7 @@ brew install autoconf \
automake \
pkgconfig \
wget \
nim@1.4.8 \
nim \
ninja \
gnu-sed \
coreutils \
Expand Down
6 changes: 3 additions & 3 deletions ci_tools_atomic_dex/src/clean.nim
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os

proc remove_vcpkg()=
if os.existsDir("vcpkg-repo"):
if os.dirExists("vcpkg-repo"):
os.removeDir("vcpkg-repo")

proc remove_build()=
if os.existsDir("build-Debug"):
if os.dirExists("build-Debug"):
os.removeDir("build-Debug")
if os.existsDir("build-Release"):
if os.dirExists("build-Release"):
os.removeDir("build-Release")

proc clean*(clean_type: string) =
Expand Down
4 changes: 2 additions & 2 deletions ci_tools_atomic_dex/src/generate.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import dependencies
proc generate_solution*(build_type: string, osx_sdk_path: string, compiler_path: string) =
download_packages()
var full_name = "build-" & build_type
if not os.existsDir(os.getCurrentDir().joinPath(full_name)):
if not os.dirExists(os.getCurrentDir().joinPath(full_name)):
echo "creating directory: " & full_name
os.createDir(full_name)
else:
Expand All @@ -16,7 +16,7 @@ proc generate_solution*(build_type: string, osx_sdk_path: string, compiler_path:
var cmd_line = "cmake -GNinja -DCMAKE_BUILD_TYPE=" & build_type & " " &
os.getCurrentDir().parentDir().parentDir()
when defined(osx):
if not osx_sdk_path.isNil() and osx_sdk_path != "nil":
if os.dirExists(osx_sdk_path):
cmd_line = cmd_line & " -DCMAKE_OSX_SYSROOT=" & osx_sdk_path & " -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15"
echo "cmd line: " & cmd_line
discard execCmd(cmd_line)
4 changes: 2 additions & 2 deletions ci_tools_atomic_dex/src/vcpkg.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ var g_vcpkg_local_path* = ""
var g_vcpkg_cmake_script_path* = ""

proc check_if_vcpkg_exists*(): bool =
result = os.existsDir("vcpkg-repo")
result = os.dirExists("vcpkg-repo")

proc build_vcpkg() =
if not os.existsFile(g_vcpkg_local_path):
if not os.fileExists(g_vcpkg_local_path):
echo "building vcpkg"
os.setCurrentDir("vcpkg-repo")
when defined(windows):
Expand Down