Linux #111
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: Linux | |
on: | |
schedule: | |
- cron: "0 8 * * *" | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [amd64, arm64] | |
include: | |
- arch: arm64 | |
is_arm: true | |
container: | |
image: ubuntu:devel | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup ccache | |
uses: actions/cache@v4 | |
with: | |
path: .ccache | |
save-always: true | |
key: ${{ github.workflow }}-${{ matrix.arch }} | |
- name: Install building tools | |
run: | | |
apt-get install --yes ca-certificates curl gnupg && curl -sL https://deb.nodesource.com/setup_21.x | bash - | |
apt-get update | |
apt-get install --yes git nodejs python3 python3-pip gcc g++ make nasm ccache linux-libc-dev linux-libc-dev-arm64-cross binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
- name: Run the script | |
env: | |
ARCH: ${{ matrix.arch }} | |
CC: "${{ matrix.is_arm && 'aarch64-linux-gnu-gcc' || 'gcc' }}" | |
CXX: "${{ matrix.is_arm && 'aarch64-linux-gnu-g++' || 'g++' }}" | |
# We don't want these variables to be set for AMD64. | |
CC_host: "${{ matrix.is_arm && 'gcc' || null }}" | |
CXX_host: "${{ matrix.is_arm && 'g++' || null }}" | |
AS: "${{ matrix.is_arm && 'aarch64-linux-gnu-as' || null }}" | |
LD: "${{ matrix.is_arm && 'aarch64-linux-gnu-ld' || null }}" | |
RANLIB: "${{ matrix.is_arm && 'aarch64-linux-gnu-ranlib' || null }}" | |
run: | | |
export CCACHE_COMPRESS="true" | |
export CCACHE_BASEDIR="$GITHUB_WORKSPACE" | |
export CCACHE_DIR="$CCACHE_BASEDIR/.ccache" | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
mkdir -p "$CCACHE_DIR" | |
node index.js | |
- name: Find the shared library | |
run: ls node/out/Release |