2021-01-08 17:16:00 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-10-05 02:29:23 +02:00
|
|
|
branches: [main]
|
2021-01-08 17:16:00 +01:00
|
|
|
pull_request:
|
2021-10-05 02:29:23 +02:00
|
|
|
branches: [main]
|
2021-01-08 17:16:00 +01:00
|
|
|
|
|
|
|
jobs:
|
2021-03-19 02:41:38 +01:00
|
|
|
lint:
|
|
|
|
name: Lint
|
2021-01-08 17:16:00 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-03-13 01:42:17 +01:00
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
2021-04-29 23:27:59 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-03-13 01:42:17 +01:00
|
|
|
|
2021-03-18 23:30:00 +01:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
|
|
|
|
2021-03-13 02:24:52 +01:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
2021-03-18 23:30:00 +01:00
|
|
|
# Cue
|
2021-03-13 02:24:52 +01:00
|
|
|
export CUE_VERSION="$(grep cue ./go.mod | cut -d' ' -f2)"
|
|
|
|
export CUE_TARBALL="cue_${CUE_VERSION}_linux_amd64.tar.gz"
|
|
|
|
echo "Installing cue version $CUE_VERSION"
|
|
|
|
curl -L https://github.com/cuelang/cue/releases/download/${CUE_VERSION}/${CUE_TARBALL} | sudo tar zxf - -C /usr/local/bin
|
|
|
|
|
2021-04-02 23:15:49 +02:00
|
|
|
- name: Go Lint
|
|
|
|
uses: golangci/golangci-lint-action@v2
|
|
|
|
with:
|
|
|
|
version: v1.39
|
|
|
|
skip-go-installation: true
|
|
|
|
args: --timeout=3m
|
|
|
|
|
2021-03-19 02:41:38 +01:00
|
|
|
- name: Lint
|
|
|
|
run: |
|
2021-07-19 16:26:18 +02:00
|
|
|
make shellcheck cuelint docslint
|
2021-03-19 02:41:38 +01:00
|
|
|
|
2021-05-22 00:02:18 +02:00
|
|
|
- name: Markdown Lint
|
2021-06-14 10:46:52 +02:00
|
|
|
uses: avto-dev/markdown-lint@v1
|
2021-05-22 00:02:18 +02:00
|
|
|
with:
|
2021-06-14 10:46:52 +02:00
|
|
|
config: ".markdownlint.yaml"
|
|
|
|
args: ./docs README.md
|
2021-05-22 00:02:18 +02:00
|
|
|
|
2021-03-19 02:41:38 +01:00
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
runs-on: ubuntu-latest
|
2021-04-08 03:50:18 +02:00
|
|
|
timeout-minutes: 30
|
2021-04-15 09:55:01 +02:00
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
make test
|
|
|
|
|
|
|
|
integration:
|
|
|
|
name: Integration
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
2021-03-19 02:41:38 +01:00
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
|
|
|
|
2021-08-13 04:32:43 +02:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
# Cue
|
|
|
|
export CUE_VERSION="$(grep cue ./go.mod | cut -d' ' -f2)"
|
|
|
|
export CUE_TARBALL="cue_${CUE_VERSION}_linux_amd64.tar.gz"
|
|
|
|
echo "Installing cue version $CUE_VERSION"
|
|
|
|
curl -L https://github.com/cuelang/cue/releases/download/${CUE_VERSION}/${CUE_TARBALL} | sudo tar zxf - -C /usr/local/bin
|
|
|
|
|
2021-03-19 02:41:38 +01:00
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
2021-03-18 23:30:00 +01:00
|
|
|
# SOPS
|
2021-05-29 19:40:01 +02:00
|
|
|
sudo curl -L -o /usr/local/bin/sops https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux
|
2021-03-18 23:30:00 +01:00
|
|
|
sudo chmod +x /usr/local/bin/sops
|
|
|
|
|
2021-05-28 03:43:48 +02:00
|
|
|
- name: Import Dagger private key
|
|
|
|
env:
|
|
|
|
DAGGER_AGE_KEY: ${{ secrets.DAGGER_AGE_KEY }}
|
|
|
|
run: |
|
2021-05-29 11:33:40 +02:00
|
|
|
mkdir -p ~/.config/dagger
|
|
|
|
echo "$DAGGER_AGE_KEY" > ~/.config/dagger/keys.txt
|
2021-05-28 03:43:48 +02:00
|
|
|
|
2021-10-05 02:28:44 +02:00
|
|
|
- name: Expose GitHub Runtime
|
|
|
|
uses: crazy-max/ghaction-github-runtime@v1
|
|
|
|
|
2021-01-14 22:50:54 +01:00
|
|
|
- name: Integration test
|
2021-10-05 02:28:44 +02:00
|
|
|
env:
|
2021-10-05 02:56:08 +02:00
|
|
|
DAGGER_CACHE_TO: "type=gha,mode=max,scope=integration"
|
|
|
|
DAGGER_CACHE_FROM: "type=gha,mode=max,scope=integration"
|
2021-01-14 22:50:54 +01:00
|
|
|
run: |
|
2021-07-23 16:05:49 +02:00
|
|
|
env
|
2021-07-01 18:47:32 +02:00
|
|
|
make core-integration
|
2021-04-15 09:19:17 +02:00
|
|
|
|
2021-07-01 18:47:32 +02:00
|
|
|
universe:
|
|
|
|
name: Universe
|
|
|
|
runs-on: ubuntu-latest
|
2021-08-31 14:39:45 +02:00
|
|
|
timeout-minutes: 20
|
2021-08-19 17:07:28 +02:00
|
|
|
services:
|
|
|
|
localstack:
|
2021-08-19 17:11:33 +02:00
|
|
|
image: localstack/localstack:0.12.16
|
2021-08-19 17:07:28 +02:00
|
|
|
env:
|
|
|
|
SERVICES: s3, ecr
|
|
|
|
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
|
|
|
|
ports:
|
|
|
|
- 4566:4566
|
|
|
|
- 4571:4571
|
2021-08-19 17:11:33 +02:00
|
|
|
- 4510:4510
|
2021-08-19 17:07:28 +02:00
|
|
|
options: >-
|
|
|
|
--health-cmd "curl -f http://localhost:4566/health"
|
|
|
|
--health-start-period 5s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-interval 5s
|
2021-10-05 02:29:23 +02:00
|
|
|
--health-retries 10
|
2021-08-19 17:07:28 +02:00
|
|
|
|
2021-07-01 18:47:32 +02:00
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v1
|
2021-04-15 09:19:17 +02:00
|
|
|
with:
|
2021-07-01 18:47:32 +02:00
|
|
|
go-version: 1.16
|
|
|
|
|
|
|
|
- name: Setup Kind Kubernetes Cluster
|
|
|
|
uses: helm/kind-action@v1.2.0
|
|
|
|
|
|
|
|
- name: Import Dagger private key
|
|
|
|
env:
|
|
|
|
DAGGER_AGE_KEY: ${{ secrets.DAGGER_AGE_KEY }}
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.config/dagger
|
|
|
|
echo "$DAGGER_AGE_KEY" > ~/.config/dagger/keys.txt
|
2021-09-09 13:03:07 +02:00
|
|
|
|
2021-08-19 17:07:28 +02:00
|
|
|
- name: Provision Localstack AWS resources
|
|
|
|
env:
|
2021-09-09 13:03:07 +02:00
|
|
|
AWS_ACCESS_KEY_ID: test
|
|
|
|
AWS_SECRET_ACCESS_KEY: test
|
|
|
|
AWS_DEFAULT_REGION: us-east-2
|
2021-08-19 17:07:28 +02:00
|
|
|
run: |
|
|
|
|
aws --endpoint-url=http://localhost:4566 s3 mb s3://dagger-ci
|
|
|
|
aws --endpoint-url=http://localhost:4566 ecr create-repository --repository-name dagger-ci
|
2021-09-09 13:03:07 +02:00
|
|
|
|
2021-10-05 02:28:44 +02:00
|
|
|
- name: Expose GitHub Runtime
|
|
|
|
uses: crazy-max/ghaction-github-runtime@v1
|
|
|
|
|
2021-07-01 18:47:32 +02:00
|
|
|
- name: Universe Test
|
2021-10-05 02:28:44 +02:00
|
|
|
env:
|
2021-10-05 02:56:08 +02:00
|
|
|
DAGGER_CACHE_TO: "type=gha,mode=max,scope=universe"
|
|
|
|
DAGGER_CACHE_FROM: "type=gha,mode=max,scope=universe"
|
2021-07-01 18:47:32 +02:00
|
|
|
run: |
|
|
|
|
make universe-test
|
2021-07-02 11:23:12 +02:00
|
|
|
|
2021-08-23 10:13:27 +02:00
|
|
|
website:
|
2021-10-05 02:56:08 +02:00
|
|
|
name: Website
|
2021-07-02 11:23:12 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Cypress run
|
|
|
|
uses: cypress-io/github-action@v2
|
|
|
|
env:
|
|
|
|
REACT_APP_CLIENT_ID: 123
|
|
|
|
REACT_APP_CLIENT_SECRET: 123
|
|
|
|
REACT_APP_DAGGER_SITE_URI: https://dagger.io
|
|
|
|
REACT_APP_API_PROXY_ENABLE: false
|
|
|
|
REACT_APP_AMPLITUDE_ID: 123
|
|
|
|
with:
|
|
|
|
config: chromeWebSecurity=false
|
|
|
|
start: |
|
|
|
|
yarn start
|
|
|
|
yarn start:withAuth
|
|
|
|
working-directory: ./website
|
|
|
|
- uses: actions/upload-artifact@v1
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: cypress-screenshots
|
|
|
|
path: website/cypress/screenshots
|
|
|
|
# Test run video was always captured, so this action uses "always()" condition
|
|
|
|
- uses: actions/upload-artifact@v1
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: cypress-videos
|
|
|
|
path: website/cypress/videos
|
2021-08-13 16:36:10 +02:00
|
|
|
doc:
|
|
|
|
name: Documentation
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 30
|
2021-08-20 16:09:35 +02:00
|
|
|
services:
|
|
|
|
localstack:
|
|
|
|
image: localstack/localstack:0.12.16
|
|
|
|
env:
|
|
|
|
SERVICES: s3, cloudformation
|
|
|
|
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
|
|
|
|
ports:
|
|
|
|
- 4566:4566
|
|
|
|
- 4571:4571
|
|
|
|
options: >-
|
|
|
|
--health-cmd "curl -f http://localhost:4566/health"
|
|
|
|
--health-start-period 5s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-interval 5s
|
2021-10-05 02:29:23 +02:00
|
|
|
--health-retries 10
|
2021-08-20 16:09:35 +02:00
|
|
|
|
2021-08-13 16:36:10 +02:00
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
# Cue
|
|
|
|
export CUE_VERSION="$(grep cue ./go.mod | cut -d' ' -f2)"
|
|
|
|
export CUE_TARBALL="cue_${CUE_VERSION}_linux_amd64.tar.gz"
|
|
|
|
echo "Installing cue version $CUE_VERSION"
|
|
|
|
curl -L https://github.com/cuelang/cue/releases/download/${CUE_VERSION}/${CUE_TARBALL} | sudo tar zxf - -C /usr/local/bin
|
|
|
|
|
|
|
|
- name: Run local registry
|
|
|
|
run: |
|
|
|
|
docker run -d -p 5000:5000 --name registry registry:2
|
|
|
|
|
|
|
|
- name: Write kind echo
|
|
|
|
run: |
|
|
|
|
echo 'kind: Cluster
|
|
|
|
apiVersion: kind.x-k8s.io/v1alpha4
|
|
|
|
containerdConfigPatches:
|
|
|
|
- |-
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:5000"]
|
|
|
|
endpoint = ["http://registry:5000"]' > ./kind-config.yaml
|
|
|
|
cat ./kind-config.yaml
|
|
|
|
|
|
|
|
- name: Setup Kind Kubernetes Cluster
|
|
|
|
uses: helm/kind-action@v1.2.0
|
|
|
|
with:
|
|
|
|
config: "./kind-config.yaml"
|
|
|
|
|
|
|
|
- name: Connect registry to cluster
|
|
|
|
run: |
|
|
|
|
docker network connect kind registry
|
|
|
|
|
|
|
|
- name: Import Dagger private key
|
|
|
|
env:
|
|
|
|
DAGGER_AGE_KEY: ${{ secrets.DAGGER_AGE_KEY }}
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.config/dagger
|
|
|
|
echo "$DAGGER_AGE_KEY" > ~/.config/dagger/keys.txt
|
|
|
|
|
2021-10-05 02:28:44 +02:00
|
|
|
- name: Expose GitHub Runtime
|
|
|
|
uses: crazy-max/ghaction-github-runtime@v1
|
|
|
|
|
2021-08-13 16:36:10 +02:00
|
|
|
- name: Documentation Test
|
2021-10-05 02:28:44 +02:00
|
|
|
env:
|
2021-10-05 02:56:08 +02:00
|
|
|
DAGGER_CACHE_TO: "type=gha,mode=max,scope=docs"
|
|
|
|
DAGGER_CACHE_FROM: "type=gha,mode=max,scope=docs"
|
2021-08-13 16:36:10 +02:00
|
|
|
run: |
|
|
|
|
make doc-test
|