ci: fix CUE linter

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2022-04-12 16:28:43 -07:00
parent 387e540114
commit 2bb6445e56
6 changed files with 16 additions and 19 deletions

View File

@ -39,7 +39,7 @@ import (
// CACHE: copy only *.cue files // CACHE: copy only *.cue files
docker.#Copy & { docker.#Copy & {
contents: source contents: source
include: ["*.cue", "**/*.cue"] include: [".git", "*.cue", "**/*.cue"]
dest: "/cue" dest: "/cue"
}, },
@ -47,6 +47,8 @@ import (
bash.#Run & { bash.#Run & {
workdir: "/cue" workdir: "/cue"
script: contents: #""" script: contents: #"""
git status
find . -name '*.cue' -not -path '*/cue.mod/*' -print | time xargs -t -n 1 -P 8 cue fmt -s find . -name '*.cue' -not -path '*/cue.mod/*' -print | time xargs -t -n 1 -P 8 cue fmt -s
test -z "$(git status -s . | grep -e "^ M" | grep "\.cue" | cut -d ' ' -f3 | tee /dev/stderr)" test -z "$(git status -s . | grep -e "^ M" | grep "\.cue" | cut -d ' ' -f3 | tee /dev/stderr)"
"""# """#

View File

@ -12,14 +12,14 @@ dagger.#Plan & {
// Run with a custom path to python // Run with a custom path to python
customPath: { customPath: {
// python:3.10-alpine has both python3 and python in the PATH // python:3.10-alpine has both python3 and python in the PATH
_image: docker.#Pull & { _image: docker.#Pull & {
source: "python:3.10-alpine" source: "python:3.10-alpine"
} }
run: python.#Run & { run: python.#Run & {
input: _image.output input: _image.output
command: name: "python" command: name: "python"
script: contents: #"print("Hello, world!")"# script: contents: #"print("Hello, world!")"#
} }
// This needs no output test because it is only testing that the command runs // This needs no output test because it is only testing that the command runs

View File

@ -7,13 +7,13 @@ import (
// Checks lua format via Stylua // Checks lua format via Stylua
#StyluaCheck: { #StyluaCheck: {
// Files to Copy // Files to Copy
source: dagger.#FS source: dagger.#FS
// Any extra formatting args // Any extra formatting args
extraArgs: [...string] extraArgs: [...string]
_run: docker.#Build & { _run: docker.#Build & {
steps: [ steps: [
docker.#Pull & { docker.#Pull & {
source: "rust:latest" source: "rust:latest"

View File

@ -8,12 +8,7 @@ import (
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "./data/hello": read: contents: dagger.#FS client: filesystem: "./data/hello": read: contents: dagger.#FS
actions: test: { actions: test: simple: fmtCheck: lua.#StyluaCheck & {
simple: { source: client.filesystem."./data/hello".read.contents
fmtCheck: lua.#StyluaCheck & {
source: client.filesystem."./data/hello".read.contents
}
}
} }
} }

View File

@ -12,8 +12,8 @@ dagger.#Plan & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: core.#Exec & { test: core.#Exec & {
input: image.output input: image.output
args: ["test", client.env.TEST_DEFAULT, "=", "hello universe"] args: ["test", client.env.TEST_DEFAULT, "=", "hello universe"]
} }
} }
} }

View File

@ -7,8 +7,8 @@ import (
dagger.#Plan & { dagger.#Plan & {
client: env: { client: env: {
TEST_STRING: string TEST_STRING: string
TEST_SECRET: dagger.#Secret TEST_SECRET: dagger.#Secret
TEST_DEFAULT: string | *"hello world" TEST_DEFAULT: string | *"hello world"
} }
actions: { actions: {