CI: Move to single-jerb #61
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
# This workflow builds a docker image with the Dev Container CLI (https://github.com/devcontainers/cli) | ||
# | ||
name: 'Build Dev Container Image' | ||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- '.devcontainer/**' | ||
- 'vcpkg.json' | ||
schedule: | ||
# https://crontab.guru/#0_0_*_*_1 | ||
- cron: '0 0 * * 1' | ||
permissions: | ||
contents: read | ||
# Push images to GHCR. | ||
packages: write | ||
env: | ||
FEDORA_VERSION: 41 | ||
jobs: | ||
build: | ||
if: github.repository == 'ADKaster/ladybird-browser' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build Ubuntu Base Dev Container Image | ||
uses: devcontainers/ci@v0.3 | ||
with: | ||
imageName: ghcr.io/adkaster/ladybird-devcontainer | ||
imageTag: base,latest | ||
push: always | ||
- name: Build Fedora CI Dev Container Image | ||
uses: devcontainers/ci@v0.3 | ||
env: | ||
VERSION: ${{ env.FEDORA_VERSION }} | ||
with: | ||
imageName: ghcr.io/adkaster/ladybird-ci-fedora | ||
imageTag: ${{ env.FEDORA_VERSION }},latest | ||
push: always | ||
configFile: .devcontainer/fedora-ci/devcontainer.json | ||
test: | ||
if: github.repository == 'ADKaster/ladybird-browser' | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/adkaster/ladybird-ci-fedora:${{ env.FEDORA_VERSION }} | ||
Check failure on line 58 in .github/workflows/dev-container.yml GitHub Actions / Build Dev Container ImageInvalid workflow file
|
||
needs: build | ||
env: | ||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set container-specific env variables | ||
# See https://github.com/actions/runner/issues/2058 | ||
# We cannot use github.workspace inside a container | ||
run: | | ||
echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV | ||
echo "DOWNLOAD_CACHE_PATH=$GITHUB_WORKSPACE/Build/caches" >> $GITHUB_ENV | ||
# TODO: Update cache key when doing a matrix build for different distros. | ||
- name: Restore Caches | ||
uses: ./.github/actions/cache-restore | ||
id: 'cache-restore' | ||
with: | ||
os: 'LinuxContainer' | ||
arch: 'x86_64' | ||
cache_key_extra: 'Fedora Nightly' | ||
ccache_path: ${{ env.CCACHE_DIR }} | ||
download_cache_path: ${{ env.DOWNLOAD_CACHE_PATH }} | ||
- name: Install vcpkg dependencies | ||
shell: bash | ||
run: ./Toolchain/BuildVcpkg.sh | ||
- name: Configure build directory | ||
shell: bash | ||
run: cmake --preset default | ||
- name: Build project | ||
shell: bash | ||
run: cmake --build --preset default | ||
- name: Run tests | ||
shell: bash | ||
run: ctest --preset default | ||
- name: Save Caches | ||
uses: ./.github/actions/cache-save | ||
with: | ||
arch: 'x86_64' | ||
ccache_path: ${{ env.CCACHE_DIR }} | ||
ccache_primary_key: ${{ steps.cache-restore.outputs.ccache_primary_key }} |