Skip to content

Commit

Permalink
chore: merge branch 'master' into add-go-udcs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Oct 9, 2023
2 parents 6a81cf8 + c403c1b commit 9050016
Show file tree
Hide file tree
Showing 44 changed files with 207 additions and 87 deletions.
11 changes: 11 additions & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
aarch
buildkit
devenv
dind
Earthfile
Earthfiles
glightbox
golines
golint
gopls
graphviz
Kroki
kubeconfig
mdlint
mkdocs
multirepo
nixos
nixpkgs
pkgs
PYTHONDONTWRITEBYTECODE
UDCs
WORKDIR
20 changes: 20 additions & 0 deletions .github/workflows/markdown-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Markdown Check

on:
workflow_call:
pull_request:

jobs:
check-markdown:
name: Check if Markdown files are properly formatted.
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.7.8
- uses: actions/checkout@v4

- name: Check all markdown files are properly formatted
run: earthly -P +markdown-check
20 changes: 20 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Spell Check

on:
workflow_call:
pull_request:

jobs:
publish:
name: Check if everything in the repo is spelled correctly.
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.7.8
- uses: actions/checkout@v4

- name: Check spelling of everything
run: earthly -P +spell-check
23 changes: 23 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Set the Earthly version to 0.7
VERSION 0.7
FROM debian:stable-slim

# cspell: words livedocs sitedocs

markdown-check:
# Check Markdown in this repo.
LOCALLY

DO ./earthly/mdlint+MDLINT_LOCALLY --src=$(echo ${PWD})

markdown-check-fix:
# Check Markdown in this repo.
LOCALLY

DO ./earthly/mdlint+MDLINT_LOCALLY --src=$(echo ${PWD}) --fix=--fix

spell-check:
# Check spelling in this repo.
LOCALLY

DO ./earthly/cspell+CSPELL_LOCALLY --src=$(echo ${PWD})
4 changes: 2 additions & 2 deletions actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
required: false
default: ""
images:
description: A space seperated list of images the target will produce
description: A space separated list of images the target will produce
required: false
default: ""
publish:
Expand All @@ -25,7 +25,7 @@ inputs:
required: false
default: ""
tags:
description: A space seperated list of tags to tag the resulting images with
description: A space separated list of tags to tag the resulting images with
required: false
default: ""
target:
Expand Down
2 changes: 2 additions & 0 deletions actions/configure-runner/src/configure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as yaml from 'js-yaml'
import { GetSecretValueCommand } from '@aws-sdk/client-secrets-manager'
import { run } from './configure'

// cspell: words camelcase tlskey tlsca tlscert

jest.mock('@actions/core', () => ({
getInput: jest.fn(),
info: jest.fn(),
Expand Down
2 changes: 2 additions & 0 deletions actions/configure-runner/src/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
SecretsManagerClient
} from '@aws-sdk/client-secrets-manager'

// cspell: words camelcase tlskey tlsca tlscert

interface CertificateSecret {
ca_certificate: string
certificate: string
Expand Down
7 changes: 1 addition & 6 deletions actions/deploy/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
_ ____ _____ ___ ___ _ _ ____ ___ ____ ____
/ \ / ___| |_ _| |_ _| / _ \ | \ | | | _ \ / _ \ / ___| / ___|

/ \_ \ | | | | | | | | | | | \| | **\_** | | | | | | | | | | \_** \ / \_** \ |
|**_ | | | | | |_| | | |\ | |\_\_\_**| | |_| | | |_| | | |**\_ \_**) | /\_/ \_\
\_**_| |_| |\_**| \_**/ |\_| \_| |\_\_**/ \_**/ \_\_**| |\_\_\_\_/
# deploy

## Description

Expand Down
4 changes: 3 additions & 1 deletion actions/deploy/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# cspell: words cibot

name: CI Deploy
description: Deploys the published images to the remote cluster.
inputs:
Expand All @@ -8,7 +10,7 @@ inputs:
description: The target environment to deploy to
required: true
images:
description: A space separted list of image names to deploy
description: A space separated list of image names to deploy
required: true
tag:
description: The image tag to deploy
Expand Down
4 changes: 2 additions & 2 deletions actions/discover/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: "Discover"
description: "Discover Earthfiles in the repository"
inputs:
parse_images:
description: Whether the image names from the given targets should be returnd (requires at least one target)
description: Whether the image names from the given targets should be returned (requires at least one target)
required: false
default: "false"
paths:
description: A space separated list of paths to search
required: false
default: "."
targets:
description: A space seperated list of targets to filter against
description: A space separated list of targets to filter against
required: false
default: ""
runs:
Expand Down
2 changes: 1 addition & 1 deletion actions/discover/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3155,7 +3155,7 @@ async function run() {
if (targets.trim() !== '') {
flags.push(...targets.split(' ').map(t => `-t ${t}`));
}
const command = ['omashu', 'scan', ...flags, paths]
const command = ['ci', 'scan', ...flags, paths]
.filter(Boolean)
.join(' ');
core.info(`Running command: ${command}`);
Expand Down
4 changes: 1 addition & 3 deletions actions/discover/src/discover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export async function run(): Promise<void> {
if (targets.trim() !== '') {
flags.push(...targets.split(' ').map(t => `-t ${t}`))
}
const command = ['omashu', 'scan', ...flags, paths]
.filter(Boolean)
.join(' ')
const command = ['ci', 'scan', ...flags, paths].filter(Boolean).join(' ')

core.info(`Running command: ${command}`)
core.setOutput('json', await execCommand(command))
Expand Down
10 changes: 6 additions & 4 deletions actions/discover/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as core from '@actions/core'
import { exec } from 'child_process'
import { run } from './discover'

// cspell: words omashu

jest.mock('@actions/core', () => ({
getBooleanInput: jest.fn(),
getInput: jest.fn(),
Expand All @@ -25,25 +27,25 @@ describe('Discover Action', () => {
jest.clearAllMocks()
})

describe('when testing running the omashu command', () => {
describe('when testing running the ci command', () => {
const testCases = [
{
parseImages: true,
paths: 'path1 path2',
targets: 'target1 target2',
expectedCommand: "omashu scan -ji -t target1 -t target2 'path1 path2'"
expectedCommand: "ci scan -ji -t target1 -t target2 'path1 path2'"
},
{
parseImages: false,
paths: 'path1',
targets: 'target1',
expectedCommand: 'omashu scan -j -t target1 path1'
expectedCommand: 'ci scan -j -t target1 path1'
},
{
parseImages: false,
paths: '.',
targets: '',
expectedCommand: 'omashu scan -j .'
expectedCommand: 'ci scan -j .'
}
]

Expand Down
2 changes: 1 addition & 1 deletion actions/install/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6776,7 +6776,7 @@ async function run() {
return;
}
const finalURL = baseURL.replace(/%VER%/g, version);
core.info(`Downlaoading version ${version} from ${finalURL}`);
core.info(`Downloading version ${version} from ${finalURL}`);
if (process.platform === 'linux') {
const downloadPath = await tool_cache.downloadTool(finalURL);
const extractPath = await tool_cache.extractTar(downloadPath, '/usr/local/bin');
Expand Down
2 changes: 2 additions & 0 deletions actions/install/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'
import { run } from './setup'

// cspell: words omashu

jest.mock('@actions/core', () => {
return {
getInput: jest.fn(),
Expand Down
4 changes: 3 additions & 1 deletion actions/install/src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'

// cspell: words omashu

const baseURL =
'https://github.com/meigma/omashu/releases/download/v%VER%/omashu-%VER%-linux_amd64.tar.gz'

Expand All @@ -14,7 +16,7 @@ export async function run(): Promise<void> {
}

const finalURL = baseURL.replace(/%VER%/g, version)
core.info(`Downlaoading version ${version} from ${finalURL}`)
core.info(`Downloading version ${version} from ${finalURL}`)
if (process.platform === 'linux') {
const downloadPath = await tc.downloadTool(finalURL)
const extractPath = await tc.extractTar(downloadPath, '/usr/local/bin')
Expand Down
7 changes: 1 addition & 6 deletions actions/setup/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
_ ____ _____ ___ ___ _ _ ____ ___ ____ ____
/ \ / ___| |_ _| |_ _| / _ \ | \ | | | _ \ / _ \ / ___| / ___|

/ \_ \ | | | | | | | | | | | \| | **\_** | | | | | | | | | | \_** \ / \_** \ |
|**_ | | | | | |_| | | |\ | |\_\_\_**| | |_| | | |_| | | |**\_ \_**) | /\_/ \_\
\_**_| |_| |\_**| \_**/ |\_| \_| |\_\_**/ \_**/ \_\_**| |\_\_\_\_/
# setup-deploy

## Description

Expand Down
2 changes: 2 additions & 0 deletions cli/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
VERSION 0.7
FROM golang:1.20-alpine3.18

# cspell: words udts onsi ldflags extldflags

fmt:
DO ../earthly/go+FMT --src="go.mod go.sum cmd pkg"

Expand Down
2 changes: 2 additions & 0 deletions cli/cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package main

// cspell: words alecthomas afero sess tfstate

import (
"encoding/json"
"fmt"
Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/executors/executors_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package executors_test

// cspell: words onsi gomega

import (
"testing"

Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/executors/local_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package executors_test

// cspell: words onsi gomega

import (
"errors"
"os/exec"
Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/git/external_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package git_test

// cspell: words onsi gomega

import (
"errors"

Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/git/git_clients_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package git_test

// cspell: words onsi gomega

import (
"testing"

Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/parsers/earthly_parser_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package parsers_test

// cspell: words onsi gomega

import (
"context"
"errors"
Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/parsers/parsers_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package parsers_test

// cspell: words onsi gomega

import (
"testing"

Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/providers/aws.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package providers

// cspell: words iface

import (
"encoding/json"
"io"
Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/providers/aws_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package providers_test

// cspell: words iface onsi gomega

import (
"bytes"
"fmt"
Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/providers/providers_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package providers_test

// cspell: words onsi gomega

import (
"testing"

Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/scanners/file_scanner.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package scanners

// cspell: words afero

import (
"os"
"path/filepath"
Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/scanners/file_scanner_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package scanners_test

// cspell: words onsi gomega afero

import (
"errors"

Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/scanners/scanners_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package scanners_test

// cspell: words onsi gomega

import (
"testing"

Expand Down
2 changes: 2 additions & 0 deletions cli/pkg/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func (s State) ParseOutput(key string, v interface{}) error {
return json.Unmarshal(output.Value, v)
}

// cspell: words unmarshalled

/*
* Output is a representation of an output from a terraform state file. The
* value is kept as a json.RawMessage so that it can be unmarshalled into the
Expand Down
Loading

0 comments on commit 9050016

Please sign in to comment.