Test #1065
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: Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: '0 15 * * 5' | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
node: [14, 16, 18, 20] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install | |
run: | | |
if type apt-get >/dev/null; then | |
clang_version=$(clang --version | perl -e '<> =~ /(\d+)\.\d+\.\d+/ && print $1') | |
sudo apt-get update -qq | |
sudo apt-get install -y --no-install-recommends lcov llvm-"${clang_version}" | |
sudo update-alternatives --install /usr/bin/llvm-cov llvm /usr/bin/llvm-cov-"${clang_version}" 100 | |
elif type brew >/dev/null; then | |
brew install lcov | |
fi | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: npm | |
- uses: actions/cache@v3 | |
with: | |
path: /home/runner/.cmake-js | |
key: ${{ matrix.node }}-cmake-js | |
- name: Setup compilers | |
if: startsWith(matrix.os, 'macos-') | |
run: | | |
cd /usr/local/bin | |
ln -sf gcc-12 gcc | |
ln -sf g++-12 g++ | |
ln -sf gcov-12 gcov | |
ln -sf /Library/Developer/CommandLineTools/usr/bin/llvm-cov . | |
- name: Test with GCC | |
run: | | |
if [[ $(uname -s) == Darwin ]]; then | |
unset NODE_JSONNET_ENABLE_COVERAGE | |
fi | |
./scripts/test-packaging.sh | |
env: | |
CC: gcc | |
CXX: g++ | |
CMAKE_BUILD_PARALLEL_LEVEL: '4' | |
NODE_JSONNET_ENABLE_COVERAGE: gcc | |
- name: Test with Clang | |
run: | | |
if [[ $(uname -s) == Darwin ]]; then | |
unset NODE_JSONNET_ENABLE_COVERAGE | |
fi | |
./scripts/test-packaging.sh | |
env: | |
CC: clang | |
CXX: clang++ | |
CMAKE_BUILD_PARALLEL_LEVEL: '4' | |
NODE_JSONNET_ENABLE_COVERAGE: clang | |
- name: Coveralls | |
continue-on-error: true | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.github_token }} | |
flag-name: ${{ matrix.os }}-${{ matrix.node }} | |
parallel: true | |
test-finish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload to Coveralls | |
continue-on-error: true | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
- uses: actions/cache@v3 | |
with: | |
path: /home/runner/.dts | |
key: ${{ runner.os }}-dtslint-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-dtslint- | |
- name: Install | |
run: npm install --ignore-scripts | |
- name: Lint | |
run: npm run lint |