Compare commits
2 Commits
feature/us
...
a47133d3df
| Author | SHA1 | Date | |
|---|---|---|---|
|
a47133d3df
|
|||
|
50a911a43c
|
@@ -2,23 +2,29 @@ FROM gentoo/stage3:latest
|
|||||||
|
|
||||||
COPY ./. /
|
COPY ./. /
|
||||||
|
|
||||||
|
ENV EGIT_CLONE_TYPE=shallow
|
||||||
|
|
||||||
RUN getuto
|
RUN getuto
|
||||||
|
|
||||||
RUN emerge-webrsync
|
RUN emerge-webrsync
|
||||||
|
|
||||||
RUN mkdir -p /var/cache/distfiles/git3-src && chown portage:portage /var/cache/distfiles/git3-src
|
|
||||||
|
|
||||||
ENV EGIT_OVERRIDE_REPO_MESONBUILD_MESON=https://jturnerusa.dev/cgit/meson
|
|
||||||
|
|
||||||
RUN emerge \
|
RUN emerge \
|
||||||
=dev-lang/rust-bin-9999 \
|
=dev-lang/rust-bin-9999 \
|
||||||
=dev-build/meson-9999::gentoo \
|
|
||||||
llvm-core/clang \
|
llvm-core/clang \
|
||||||
llvm-core/lld \
|
llvm-core/lld \
|
||||||
dev-vcs/git \
|
dev-vcs/git \
|
||||||
sys-process/parallel \
|
sys-process/parallel \
|
||||||
net-libs/nodejs
|
net-libs/nodejs
|
||||||
|
|
||||||
|
|
||||||
|
RUN git clone https://jturnerusa.dev/cgit/ebuilds/ /var/db/repos/spawns
|
||||||
|
|
||||||
|
COPY etc/portage/repos.conf /etc/portage/
|
||||||
|
|
||||||
|
RUN mkdir -p /var/cache/distfiles/git3-src && chown portage:portage /var/cache/distfiles/git3-src
|
||||||
|
|
||||||
|
RUN emerge =dev-build/meson-9999::spawns
|
||||||
|
|
||||||
RUN useradd -m gentooligan
|
RUN useradd -m gentooligan
|
||||||
|
|
||||||
USER gentooligan
|
USER gentooligan
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
sec-keys/jturnerusa
|
|
||||||
@@ -22,48 +22,54 @@ jobs:
|
|||||||
key: gitea-repo-${{ gitea.repository }}-${{ gitea.ref }}
|
key: gitea-repo-${{ gitea.repository }}-${{ gitea.ref }}
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Detect Changes
|
- name: Check for changes before building
|
||||||
uses: dorny/paths-filter@v3
|
|
||||||
id: image-changes
|
id: image-changes
|
||||||
with:
|
# build image only if 1. changes are detected or 2. an image for the working branch doesnt exist
|
||||||
filters: |
|
|
||||||
docker:
|
|
||||||
- ".docker/**"
|
|
||||||
|
|
||||||
- name: Metadata
|
|
||||||
id: metadata
|
|
||||||
run: |
|
run: |
|
||||||
branch_name="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
branch_name="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
||||||
default_branch_name="${{ gitea.event.repository.default_branch }}"
|
default_branch_name="${{ gitea.event.repository.default_branch }}"
|
||||||
image_tag=latest
|
image_tag=latest
|
||||||
if [[ $default_branch_name != $branch_name ]]; then
|
comparison_hash="${{ gitea.event.before }}"
|
||||||
this_image_tag="$(echo "$branch_name" | sed -E 's/[^a-zA-Z0-9]/-/g')"
|
|
||||||
echo "steps... ${{ steps.image-changes.outputs.docker }}"
|
if [[ "$branch_name" != "$default_branch_name" ]]; then
|
||||||
if [[ ${{ steps.image-changes.outputs.docker }} == true ]] || docker manifest inspect ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${this_image_tag} >/dev/null 2>&1; then
|
image_tag=$branch_name
|
||||||
image_tag=$this_image_tag
|
fi
|
||||||
fi
|
# slugify
|
||||||
else
|
image_tag="$(echo "$image_tag" | sed -E 's/[^a-zA-Z0-9]/-/g')"
|
||||||
|
|
||||||
|
# rebase breaks gitea.event.before, so check to make sure the hash provided exists
|
||||||
|
if ! git merge-base --is-ancestor $comparison_hash $branch_name >/dev/null 2>&1; then
|
||||||
|
comparison_hash=$(git merge-base origin/$default_branch_name $branch_name)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git diff $comparison_hash ${{ gitea.sha }} --no-patch --exit-code .docker; then
|
||||||
build_image=true
|
build_image=true
|
||||||
|
else
|
||||||
|
if ! docker manifest inspect ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${image_tag} >/dev/null 2>&1; then
|
||||||
|
build_image=true
|
||||||
|
else
|
||||||
|
build_image=false
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "default_branch_name=$default_branch_name" >> $GITEA_OUTPUT
|
echo "default_branch_name=$default_branch_name" >> $GITEA_OUTPUT
|
||||||
echo "branch_name=$branch_name" >> $GITEA_OUTPUT
|
echo "branch_name=$branch_name" >> $GITEA_OUTPUT
|
||||||
echo "image_tag=$image_tag" >> $GITEA_OUTPUT
|
echo "image_tag=$image_tag" >> $GITEA_OUTPUT
|
||||||
echo "build_image=${build_image:-${{ steps.image-changes.outputs.docker }}}" >> $GITEA_OUTPUT
|
echo "comparison_hash=$comparison_hash" >> $GITEA_OUTPUT
|
||||||
|
echo "build_image=$build_image" >> $GITEA_OUTPUT
|
||||||
cat $GITEA_OUTPUT
|
cat $GITEA_OUTPUT
|
||||||
|
|
||||||
- name: Set up Docker buildx
|
- name: Set up Docker buildx
|
||||||
if: steps.metadata.outputs.build_image == 'true'
|
if: steps.image-changes.outputs.build_image == 'true'
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
driver-opts: network=runners-net
|
driver-opts: network=runners-net
|
||||||
|
|
||||||
- name: Log in to Github Container Registry
|
- name: Log in to Github Container Registry
|
||||||
if: steps.metadata.outputs.build_image == 'true'
|
if: steps.image-changes.outputs.build_image == 'true'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.REGISTRY_URL }}
|
registry: ${{ vars.REGISTRY_URL }}
|
||||||
@@ -71,58 +77,47 @@ jobs:
|
|||||||
password: ${{ secrets.CI_BOT_TOKEN }}
|
password: ${{ secrets.CI_BOT_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
if: steps.metadata.outputs.build_image == 'true'
|
if: steps.image-changes.outputs.build_image == 'true'
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ steps.metadata.outputs.image_tag }}
|
tags: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ steps.image-changes.outputs.image_tag }}
|
||||||
context: "{{defaultContext}}:.docker"
|
context: "{{defaultContext}}:.docker"
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
outputs:
|
outputs:
|
||||||
image_tag: ${{ steps.metadata.outputs.image_tag }}
|
image_tag: ${{ steps.image-changes.outputs.image_tag }}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: gentoo
|
runs-on: brutalisk
|
||||||
env:
|
env:
|
||||||
CC: "clang"
|
CC: 'clang'
|
||||||
CXX: "clang++"
|
CXX: 'clang++'
|
||||||
needs: build-oci-image
|
needs: build-oci-image
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
# TODO: This is currently unused by other jobs. I couldn't make meson not regenerate things regardless of
|
- name: build and check
|
||||||
# the build dir already existing.
|
|
||||||
- name: Build Cache Setup
|
|
||||||
uses: actions/cache@v5
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
subprojects
|
|
||||||
build
|
|
||||||
key: build-${{ gitea.repository }}-${{ gitea.sha }}
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
run: |
|
||||||
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized -Ddocs=enabled build
|
meson setup -Dfuzz=enabled -Dtests=enabled -Dbuildtype=debugoptimized -Ddocs=enabled build
|
||||||
meson compile -C build
|
meson compile -C build
|
||||||
|
|
||||||
|
|
||||||
# FIXME: Currently this rebuilds everything. Instead we should bring over the build dir from the build job. This will come in handy
|
# FIXME: Currently this rebuilds everything. Instead we should bring over the build dir from the build job. This will come in handy
|
||||||
# when we have multiple build targets and configs. What we have currently is fine until we get lots of builds going
|
# when we have multiple build targets and configs. What we have currently is fine until we get lots of builds going
|
||||||
test:
|
test:
|
||||||
runs-on: gentoo
|
runs-on: brutalisk
|
||||||
env:
|
env:
|
||||||
CC: "clang"
|
CC: 'clang'
|
||||||
CXX: "clang++"
|
CXX: 'clang++'
|
||||||
needs: [build-oci-image]
|
needs: [build-oci-image, build]
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
run: |
|
run: |
|
||||||
@@ -131,17 +126,17 @@ jobs:
|
|||||||
ninja test -C build
|
ninja test -C build
|
||||||
|
|
||||||
fuzz:
|
fuzz:
|
||||||
runs-on: gentoo
|
runs-on: brutalisk
|
||||||
env:
|
env:
|
||||||
CC: "clang"
|
CC: 'clang'
|
||||||
CXX: "clang++"
|
CXX: 'clang++'
|
||||||
FUZZER_TIMEOUT_S: 300
|
FUZZER_TIMEOUT_S: 300
|
||||||
needs: [build-oci-image]
|
needs: [build-oci-image, build]
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
# FIXME: Get rid of this step when portage has fixes merged?
|
# FIXME: Get rid of this step when portage has fixes merged?
|
||||||
# needed because portage has fixes upstream we need that arent stable yet
|
# needed because portage has fixes upstream we need that arent stable yet
|
||||||
@@ -163,13 +158,13 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
check-format:
|
check-format:
|
||||||
runs-on: gentoo
|
runs-on: brutalisk
|
||||||
needs: [build-oci-image]
|
needs: [build-oci-image]
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Check Formatting
|
- name: Check Formatting
|
||||||
run: |
|
run: |
|
||||||
@@ -178,13 +173,13 @@ jobs:
|
|||||||
ninja rustfmt -C build
|
ninja rustfmt -C build
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
runs-on: gentoo
|
runs-on: brutalisk
|
||||||
needs: [build-oci-image]
|
needs: [build-oci-image]
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Build Documentation
|
- name: Build Documentation
|
||||||
run: |
|
run: |
|
||||||
@@ -192,13 +187,13 @@ jobs:
|
|||||||
ninja rustdoc -C docs
|
ninja rustdoc -C docs
|
||||||
|
|
||||||
grep:
|
grep:
|
||||||
runs-on: gentoo
|
runs-on: brutalisk
|
||||||
needs: [build-oci-image]
|
needs: [build-oci-image]
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
image: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}:${{ needs.build-oci-image.outputs.image_tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: grep for patterns
|
- name: grep for patterns
|
||||||
# negate git grep ret code because 1 means no findings
|
# negate git grep ret code because 1 means no findings
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,5 +2,4 @@
|
|||||||
/subprojects
|
/subprojects
|
||||||
!/subprojects
|
!/subprojects
|
||||||
/subprojects/*
|
/subprojects/*
|
||||||
!/subprojects/packagefiles
|
!/subprojects/packagefiles
|
||||||
!/subprojects/*.wrap
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
[wrap-file]
|
|
||||||
directory = thiserror-2.0.17
|
|
||||||
source_url = https://crates.io/api/v1/crates/thiserror/2.0.17/download
|
|
||||||
source_filename = thiserror-2.0.17.tar.gz
|
|
||||||
source_hash = f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8
|
|
||||||
method = cargo
|
|
||||||
diff_files = thiserror-2.0.17-include.patch
|
|
||||||
|
|
||||||
# bump this version number on every change to meson.build or the patches:
|
|
||||||
# v2
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
[wrap-file]
|
|
||||||
directory = thiserror-impl-2.0.17
|
|
||||||
source_url = https://crates.io/api/v1/crates/thiserror-impl/2.0.17/download
|
|
||||||
source_filename = thiserror-impl-2.0.17.tar.gz
|
|
||||||
source_hash = 3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913
|
|
||||||
method = cargo
|
|
||||||
diff_files = thiserror-impl-2.0.17-include.patch
|
|
||||||
|
|
||||||
# bump this version number on every change to meson.build or the patches:
|
|
||||||
# v2
|
|
||||||
Reference in New Issue
Block a user