This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/.github/workflows/ci.yml
Tom Chauveau 794f27f116 Update setup kind cluster action
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-06-30 16:10:46 +02:00

112 lines
2.7 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v2
with:
fetch-depth: 0
- 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: Go Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.39
skip-go-installation: true
args: --timeout=3m
- name: Lint
run: |
make shellcheck cuelint check-buildkit-version docslint
- name: Markdown Lint
uses: avto-dev/markdown-lint@v1
with:
config: ".markdownlint.yaml"
args: ./docs README.md
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 30
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
steps:
- name: Check out
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: Setup Kind Kubernetes Cluster
uses: helm/kind-action@v1.2.0
- name: Install Dependencies
run: |
# SOPS
sudo curl -L -o /usr/local/bin/sops https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux
sudo chmod +x /usr/local/bin/sops
- 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
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Integration test
run: |
make integration
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: always()
with:
report_paths: "tests/*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: "Report"