2021-01-08 17:16:00 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
pull_request:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
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-06-09 03:57:45 +02:00
|
|
|
make shellcheck cuelint check-buildkit-version 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-04-16 16:29:54 +02:00
|
|
|
- name: Setup Kind Kubernetes Cluster
|
|
|
|
uses: engineerd/setup-kind@v0.5.0
|
|
|
|
|
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-03-13 01:42:17 +01:00
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2021-01-14 22:50:54 +01:00
|
|
|
- name: Integration test
|
|
|
|
run: |
|
|
|
|
make integration
|
2021-04-15 09:19:17 +02:00
|
|
|
|
|
|
|
- name: Publish Test Report
|
|
|
|
uses: mikepenz/action-junit-report@v2
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
report_paths: "tests/*.xml"
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-15 09:55:01 +02:00
|
|
|
check_name: "Report"
|