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-04-14 23:47:46 +02:00
|
|
|
make shellcheck cuelint check-buildkit-version
|
2021-03-19 02:41:38 +01:00
|
|
|
|
2021-05-22 00:02:18 +02:00
|
|
|
- name: Markdown Lint
|
|
|
|
uses: nosborn/github-action-markdown-cli@v1.1.1
|
|
|
|
with:
|
|
|
|
files: ./docs README.md
|
|
|
|
config_file: ".markdownlint.yaml"
|
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
2021-03-18 23:30:00 +01:00
|
|
|
# SOPS
|
|
|
|
sudo curl -L -o /usr/local/bin/sops https://github.com/mozilla/sops/releases/download/v3.6.1/sops-v3.6.1.linux
|
|
|
|
sudo chmod +x /usr/local/bin/sops
|
|
|
|
|
|
|
|
- name: Import PGP private key
|
2021-03-13 01:42:17 +01:00
|
|
|
env:
|
2021-03-18 23:30:00 +01:00
|
|
|
SOPS_PGP_KEY: ${{ secrets.SOPS_PGP_KEY }}
|
2021-03-13 02:24:52 +01:00
|
|
|
run: |
|
2021-03-18 23:30:00 +01:00
|
|
|
echo "$SOPS_PGP_KEY" | base64 -d | gpg --import
|
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"
|