Skip to content

dev-init: fix direnv discovery messages [] #10

dev-init: fix direnv discovery messages []

dev-init: fix direnv discovery messages [] #10

# Part of the EDG Compiler Project, under the Apache License v2.0 with LLVM
# Exceptions.
# See https://edgcpp.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# Runs the equivalent configure -> build -> test sequence as:
#
# edg-docker-test --posture=extensive --non-interactive
#
# inside the edgcpp/ci-runner image. Jobs are staged so GitHub can schedule
# them in parallel, with each test leg waiting only on its own build (and the
# shared timestamp, which runs alongside the builds):
#
# prepare ───────────────┬──► test-gcc ──┐
# build-gcc ─────────────┘ ├──► publish (on failure)
# prepare ───────────────┬──► test-i686 ──┘
# build-i686 ────────────┘
#
# A shared run timestamp keeps results under the same tests/runs/<timestamp>/
# tree; the publish job republishes failure artifacts from all test legs.
name: Build & Test CI
on:
push:
branches:
- main
pull_request:
jobs:
prepare:
name: Prepare run timestamp
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
run_timestamp: ${{ steps.timestamp.outputs.run_timestamp }}
steps:
- name: Declare shared edgy run timestamp
id: timestamp
run: |
# Match edgutil.RUN_TIMESTAMP_FORMAT (%Y.%m.%d-%H.%M.%S).
echo "run_timestamp=$(date -u +'%Y.%m.%d-%H.%M.%S')" >> "${GITHUB_OUTPUT}"
build-gcc:
name: Build linux-gcc-debug
runs-on: ubuntu-latest
timeout-minutes: 120
container:
image: docker.io/edgcpp/ci-runner:latest
defaults:
run:
shell: edg-container-exec "bash -eo pipefail {0}"
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Configure linux-gcc-debug
env:
EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc
run: cmake --preset linux-gcc-debug
- name: Build linux-gcc-debug
env:
EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc
run: cmake --build build/gcc
# Runtime layout only: environment.sh / eccp need bin/, lib/, and the
# per-target lib_linux_* / lib_win* dirs (eccp rewrites ECCP_LIBDIR to
# lib_<target>). lib_src is build-only and omitted.
- name: Upload build products
uses: actions/upload-artifact@v7
with:
name: build-linux-gcc-debug
path: |
build/gcc/bin
build/gcc/lib
build/gcc/lib_linux_*
build/gcc/lib_win*
build/gcc/environment.sh
if-no-files-found: error
retention-days: 1
compression-level: 6
build-i686:
name: Build linux-i686-gcc-debug
runs-on: ubuntu-latest
timeout-minutes: 120
container:
image: docker.io/edgcpp/ci-runner:latest
defaults:
run:
shell: edg-container-exec "bash -eo pipefail {0}"
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Configure linux-i686-gcc-debug
env:
EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc-i686
run: cmake --preset linux-i686-gcc-debug
- name: Build linux-i686-gcc-debug
env:
EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc-i686
run: cmake --build build/gcc-i686
- name: Upload build products
uses: actions/upload-artifact@v7
with:
name: build-linux-i686-gcc-debug
path: |
build/gcc-i686/bin
build/gcc-i686/lib
build/gcc-i686/lib_linux_*
build/gcc-i686/lib_win*
build/gcc-i686/environment.sh
if-no-files-found: error
retention-days: 1
compression-level: 6
test-gcc:
name: Test ${{ matrix.config }}
needs:
- prepare
- build-gcc
runs-on: ubuntu-latest
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
config:
- edg_x86_64
- edg_x86_64_cp
container:
image: docker.io/edgcpp/ci-runner:latest
# Required for setarch ... -R (disable ASLR) used by the test harness.
options: --privileged
defaults:
run:
shell: edg-container-exec "bash -eo pipefail {0}"
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Download linux-gcc-debug build
uses: actions/download-artifact@v7
with:
name: build-linux-gcc-debug
# upload-artifact strips the shared build/gcc/ prefix, leaving
# bin/, lib/, and environment.sh at the artifact root.
path: build/gcc
- name: Restore execute bits on build binaries
run: |
# Artifact round-trip does not reliably preserve +x.
chmod -R a+x build/gcc/bin
- name: Run edgy (${{ matrix.config }})
env:
RUN_TIMESTAMP: ${{ needs.prepare.outputs.run_timestamp }}
CONFIG: ${{ matrix.config }}
run: |
mkdir -p .tmp
cat > .tmp/extensive-ci-edg-base.sh <<EOF
export EDG_BASE="${GITHUB_WORKSPACE}/bases/docker/dev-env/gcc"
EOF
cat > .tmp/extensive-ci.edgivk <<EOF
prefix_source TEST_${CONFIG} build/gcc/environment.sh
prefix_source TEST_${CONFIG} .tmp/extensive-ci-edg-base.sh
exec edgy --config="${CONFIG}" --run-timestamp="${RUN_TIMESTAMP}" --max-failure-count=10 --timeout=600 -A --meticulous all
EOF
edg-prefix-env-loader .tmp/extensive-ci.edgivk
- name: Upload partial elist, elog, and .rt.tar.gz results
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.config }}
path: |
tests/runs/${{ needs.prepare.outputs.run_timestamp }}/**/*.elist
tests/runs/${{ needs.prepare.outputs.run_timestamp }}/**/*.elog
tests/runs/${{ needs.prepare.outputs.run_timestamp }}/**/*.rt.tar.gz
if-no-files-found: warn
retention-days: 1
test-i686:
name: Test ${{ matrix.config }}
needs:
- prepare
- build-i686
runs-on: ubuntu-latest
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
config:
- edg_x86_32
- edg_x86_32_cp
container:
image: docker.io/edgcpp/ci-runner:latest
# Required for setarch ... -R (disable ASLR) used by the test harness.
options: --privileged
defaults:
run:
shell: edg-container-exec "bash -eo pipefail {0}"
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Download linux-i686-gcc-debug build
uses: actions/download-artifact@v7
with:
name: build-linux-i686-gcc-debug
# upload-artifact strips the shared build/gcc-i686/ prefix, leaving
# bin/, lib/, and environment.sh at the artifact root.
path: build/gcc-i686
- name: Restore execute bits on build binaries
run: |
# Artifact round-trip does not reliably preserve +x.
chmod -R a+x build/gcc-i686/bin
- name: Run edgy (${{ matrix.config }})
env:
RUN_TIMESTAMP: ${{ needs.prepare.outputs.run_timestamp }}
CONFIG: ${{ matrix.config }}
run: |
mkdir -p .tmp
cat > .tmp/extensive-ci-edg-base.sh <<EOF
export EDG_BASE="${GITHUB_WORKSPACE}/bases/docker/dev-env/gcc-i686"
EOF
cat > .tmp/extensive-ci.edgivk <<EOF
prefix_source TEST_${CONFIG} build/gcc-i686/environment.sh
prefix_source TEST_${CONFIG} .tmp/extensive-ci-edg-base.sh
exec edgy --config="${CONFIG}" --run-timestamp="${RUN_TIMESTAMP}" --max-failure-count=10 --timeout=600 -A --meticulous all
EOF
edg-prefix-env-loader .tmp/extensive-ci.edgivk
- name: Upload partial elist, elog, and .rt.tar.gz results
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.config }}
path: |
tests/runs/${{ needs.prepare.outputs.run_timestamp }}/**/*.elist
tests/runs/${{ needs.prepare.outputs.run_timestamp }}/**/*.elog
tests/runs/${{ needs.prepare.outputs.run_timestamp }}/**/*.rt.tar.gz
if-no-files-found: warn
retention-days: 1
publish-test-results:
name: Publish aggregated test results
needs:
- prepare
- test-gcc
- test-i686
# Republish whenever any test leg failed (partial artifacts may exist).
if: >-
${{ always() &&
(needs.test-gcc.result == 'failure' ||
needs.test-i686.result == 'failure') }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Download partial test-result artifacts
uses: actions/download-artifact@v7
with:
pattern: test-results-*
path: aggregated-test-results
merge-multiple: true
- name: Upload elist, elog, and .rt.tar.gz results
uses: actions/upload-artifact@v7
with:
name: test-results-all
path: aggregated-test-results/
if-no-files-found: warn
retention-days: 14