ladybird/.github/workflows/serenity-js-artifacts.yml
Daniel Bertalan 18ee6e457d CI: Update actions/cache to v3
This version now natively supports read-only caches (`cache/restore@v3`)
so we no longer need to pin the version to a commit in actions/cache#489
which is an unmerged PR.

The update is mostly mechanical:
- Steps with `CACHE_SKIP_SAVE` not set can use the plain `cache@v3`
  action.
- Steps with `CACHE_SKIP_SAVE` set to a constant `true` are changed to
  `cache/restore@v3`.
- Steps with saving disabled when running on a pull request are changed
  to a pair of `cache/restore@v3` and `cache/save@v3`. This setup is
  used for the large (100s of MB) ccache and Toolchain caches. As caches
  saved in pull requests can only be utilized from within the same PR,
  uploading these would only waste time and our storage quote.
  Therefore, we skip the `save` steps if running on a PR.

Co-authored-by: Cameron Youell <cameronyouell@gmail.com>
2023-05-28 05:05:09 -06:00

108 lines
3.2 KiB
YAML

name: Package the js repl as a binary artifact
on: [push]
env:
SERENITY_SOURCE_DIR: ${{ github.workspace }}
jobs:
build-and-package:
runs-on: ${{ matrix.os }}
if: always() && github.repository == 'SerenityOS/serenity' && github.ref == 'refs/heads/master'
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
package_type: [Linux-x86_64]
include:
- os: macos-13
package_type: macOS-universal2
concurrency:
group: ${{ github.workflow }}-${{ matrix.os }}
cancel-in-progress: true
steps:
- name: Checkout SerenityOS/serenity
uses: actions/checkout@v3
- name: Install dependencies Ubuntu
run: |
sudo apt-get update
sudo apt-get install -y ninja-build unzip gcc-12 g++-12
if: ${{ matrix.os == 'ubuntu-22.04' }}
- name: Install dependencies macOS
run: |
brew install bash ninja unzip
if: ${{ matrix.os == 'macos-13' }}
- name: Select Xcode version
uses: mobiledevops/xcode-select-version-action@v1
with:
xcode-select-version: 14.3
if: ${{ matrix.os == 'macos-13' }}
- name: Check versions Ubuntu
run: |
ninja --version; gcc-12 --version; g++-12 --version
if: ${{ matrix.os == 'ubuntu-22.04' }}
- name: Check versions macOS
run: |
ninja --version; clang++ --version
if: ${{ matrix.os == 'macos-13' }}
- name: Create build directory
run: |
mkdir -p Build/TZDB
mkdir -p Build/UCD
mkdir -p Build/CLDR
- name: TimeZoneData cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/libjs-test262/Build/TZDB
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
- name: UnicodeData cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/libjs-test262/Build/UCD
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
- name: UnicodeLocale cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/libjs-test262/Build/CLDR
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}
- name: Create build directory Ubuntu
run: |
cmake -S Meta/Lagom -B Build -G Ninja \
-DCMAKE_C_COMPILER=gcc-12 \
-DCMAKE_CXX_COMPILER=g++-12 \
-DBUILD_LAGOM=ON
if: ${{ matrix.os == 'ubuntu-22.04' }}
- name: Create build directory macOS
run: |
# Note: We are using Apple Clang to create Universal binary
cmake -S Meta/Lagom -B Build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \
-DBUILD_LAGOM=ON
if: ${{ matrix.os == 'macos-13' }}
- name: Build and package js
working-directory: Build
run: |
ninja js
cpack
- name: Upload js package
uses: actions/upload-artifact@v3
with:
name: serenity-js-${{ matrix.package_type }}
path: Build/serenity-js*.tar.gz
retention-days: 7