fix(ci): Build all features for each package and build all archs
This commit is contained in:
parent
ddfacd3492
commit
c8d8ab306c
5 changed files with 38 additions and 15 deletions
4
.github/workflows/build-pr.yml
vendored
4
.github/workflows/build-pr.yml
vendored
|
|
@ -115,7 +115,7 @@ jobs:
|
||||||
- name: Run build
|
- name: Run build
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
earthly --ci --push -P +build-images
|
earthly --ci --push -P +build-images-all
|
||||||
|
|
||||||
build-scripts:
|
build-scripts:
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
|
@ -140,7 +140,7 @@ jobs:
|
||||||
- name: Run build
|
- name: Run build
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
earthly --ci --push -P +build-scripts
|
earthly --ci --push -P +build-scripts-all
|
||||||
|
|
||||||
integration-tests:
|
integration-tests:
|
||||||
permissions:
|
permissions:
|
||||||
|
|
|
||||||
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
|
|
@ -172,7 +172,7 @@ jobs:
|
||||||
- name: Run build
|
- name: Run build
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
earthly --ci --push -P +build-scripts
|
earthly --ci --push -P +build-scripts-all
|
||||||
|
|
||||||
build-images:
|
build-images:
|
||||||
permissions:
|
permissions:
|
||||||
|
|
@ -215,11 +215,11 @@ jobs:
|
||||||
|
|
||||||
- name: Run build
|
- name: Run build
|
||||||
if: github.repository == 'blue-build/cli'
|
if: github.repository == 'blue-build/cli'
|
||||||
run: earthly --push --ci -P +build-images
|
run: earthly --push --ci -P +build-images-all
|
||||||
|
|
||||||
- name: Run build fork
|
- name: Run build fork
|
||||||
if: github.repository != 'blue-build/cli'
|
if: github.repository != 'blue-build/cli'
|
||||||
run: earthly --ci -P +build-images
|
run: earthly --ci -P +build-images-all
|
||||||
|
|
||||||
integration-tests:
|
integration-tests:
|
||||||
permissions:
|
permissions:
|
||||||
|
|
|
||||||
4
.github/workflows/tag.yml
vendored
4
.github/workflows/tag.yml
vendored
|
|
@ -102,7 +102,7 @@ jobs:
|
||||||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||||
CARGO_PACKAGE_VERSION="v$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "blue-build") .version')"
|
CARGO_PACKAGE_VERSION="v$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "blue-build") .version')"
|
||||||
LATEST=$(test "$CARGO_PACKAGE_VERSION" = "$LATEST_TAG" && echo true || echo false)
|
LATEST=$(test "$CARGO_PACKAGE_VERSION" = "$LATEST_TAG" && echo true || echo false)
|
||||||
earthly --ci --push +build-scripts --TAGGED="true" --LATEST="$LATEST"
|
earthly --ci --push +build-scripts-all --TAGGED="true" --LATEST="$LATEST"
|
||||||
|
|
||||||
build-images:
|
build-images:
|
||||||
permissions:
|
permissions:
|
||||||
|
|
@ -140,4 +140,4 @@ jobs:
|
||||||
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||||
CARGO_PACKAGE_VERSION="v$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "blue-build") .version')"
|
CARGO_PACKAGE_VERSION="v$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "blue-build") .version')"
|
||||||
LATEST=$(test "$CARGO_PACKAGE_VERSION" = "$LATEST_TAG" && echo true || echo false)
|
LATEST=$(test "$CARGO_PACKAGE_VERSION" = "$LATEST_TAG" && echo true || echo false)
|
||||||
earthly --push --ci -P +build-images --TAGGED="true" --LATEST="$LATEST"
|
earthly --push --ci -P +build-images-all --TAGGED="true" --LATEST="$LATEST"
|
||||||
|
|
|
||||||
36
Earthfile
36
Earthfile
|
|
@ -16,6 +16,12 @@ run-checks:
|
||||||
BUILD +lint
|
BUILD +lint
|
||||||
BUILD +test
|
BUILD +test
|
||||||
|
|
||||||
|
build-images-all:
|
||||||
|
BUILD --platform=linux/amd64 --platform=linux/arm64 +build-images
|
||||||
|
|
||||||
|
build-scripts-all:
|
||||||
|
BUILD --platform=linux/amd64 --platform=linux/arm64 +build-scripts
|
||||||
|
|
||||||
build-images:
|
build-images:
|
||||||
BUILD +blue-build-cli
|
BUILD +blue-build-cli
|
||||||
BUILD +blue-build-cli-distrobox
|
BUILD +blue-build-cli-distrobox
|
||||||
|
|
@ -31,12 +37,7 @@ lint:
|
||||||
DO rust+CARGO --args="clippy"
|
DO rust+CARGO --args="clippy"
|
||||||
DO rust+CARGO --args="clippy --all-features"
|
DO rust+CARGO --args="clippy --all-features"
|
||||||
DO rust+CARGO --args="clippy --no-default-features"
|
DO rust+CARGO --args="clippy --no-default-features"
|
||||||
FOR feat IN $( \
|
DO +EACH_PACKAGE --args="clippy --no-default-features"
|
||||||
cargo metadata --format-version 1 \
|
|
||||||
| jq -cr '.packages[] | select(.name == "blue-build") | .features | keys | .[] | select(. != "default")' \
|
|
||||||
)
|
|
||||||
DO rust+CARGO --args="clippy --no-default-features --features $feat"
|
|
||||||
END
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
FROM +common
|
FROM +common
|
||||||
|
|
@ -46,11 +47,30 @@ test:
|
||||||
DO rust+CARGO --args="test --workspace"
|
DO rust+CARGO --args="test --workspace"
|
||||||
DO rust+CARGO --args="test --workspace --all-features"
|
DO rust+CARGO --args="test --workspace --all-features"
|
||||||
DO rust+CARGO --args="test --workspace --no-default-features"
|
DO rust+CARGO --args="test --workspace --no-default-features"
|
||||||
|
DO +EACH_PACKAGE --args="test --no-default-features"
|
||||||
|
|
||||||
|
EACH_PACKAGE:
|
||||||
|
FUNCTION
|
||||||
|
ARG --required args
|
||||||
|
|
||||||
|
FOR package IN $( \
|
||||||
|
cargo metadata --format-version 1 \
|
||||||
|
| jq -cr '.workspace_members | .[]' \
|
||||||
|
| sed 's|.*#||' | sed 's|@.*||' \
|
||||||
|
)
|
||||||
|
DO --pass-args +EACH_FEAT --package="$package"
|
||||||
|
END
|
||||||
|
|
||||||
|
EACH_FEAT:
|
||||||
|
FUNCTION
|
||||||
|
ARG --required args
|
||||||
|
ARG --required package
|
||||||
|
|
||||||
FOR feat IN $( \
|
FOR feat IN $( \
|
||||||
cargo metadata --format-version 1 \
|
cargo metadata --format-version 1 \
|
||||||
| jq -cr '.packages[] | select(.name == "blue-build") | .features | keys | .[] | select(. != "default")' \
|
| jq -cr ".packages[] | select(.name == \"$package\") | .features | keys | .[] | select(. != \"default\")" \
|
||||||
)
|
)
|
||||||
DO rust+CARGO --args="test --workspace --features $feat"
|
DO rust+CARGO --args="$args --package $package --features $feat"
|
||||||
END
|
END
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
|
|
||||||
3
justfile
3
justfile
|
|
@ -97,6 +97,9 @@ tools:
|
||||||
release *args:
|
release *args:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
|
earthly --ci +run-checks
|
||||||
|
|
||||||
# --workspace: updating all crates in the workspace
|
# --workspace: updating all crates in the workspace
|
||||||
# --no-tag: do not push tag for each new version
|
# --no-tag: do not push tag for each new version
|
||||||
# --no-confirm: don't look for user input, just run the command
|
# --no-confirm: don't look for user input, just run the command
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue