8fe29cdc76
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
88 lines
1.8 KiB
YAML
88 lines
1.8 KiB
YAML
name: "Dagger CI"
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "**.sh"
|
|
- "**.bash"
|
|
- "**.go"
|
|
- "**.cue"
|
|
- "**.bats"
|
|
- "Makefile"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
- ".github/workflows/dagger-ci.yml"
|
|
pull_request:
|
|
branches: [main]
|
|
paths:
|
|
- "**.sh"
|
|
- "**.bash"
|
|
- "**.go"
|
|
- "**.cue"
|
|
- "**.bats"
|
|
- "Makefile"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
- ".github/workflows/dagger-ci.yml"
|
|
|
|
env:
|
|
DAGGER_LOG_FORMAT: plain
|
|
|
|
jobs:
|
|
build:
|
|
name: "Build"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: "Setup Go"
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.16
|
|
|
|
- name: "Expose GitHub Runtime"
|
|
uses: crazy-max/ghaction-github-runtime@v1
|
|
|
|
- name: Prepare dagger
|
|
run: |
|
|
make dagger
|
|
cp ./cmd/dagger/dagger /usr/local/bin
|
|
|
|
- name: Build
|
|
env:
|
|
DAGGER_CACHE_TO: "type=gha,mode=max,scope=dagger-ci-build"
|
|
DAGGER_CACHE_FROM: "type=gha,scope=dagger-ci-build"
|
|
run: |
|
|
cd ci
|
|
dagger do build
|
|
|
|
lint:
|
|
name: "Lint"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: "Setup Go"
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.16
|
|
|
|
- name: "Expose GitHub Runtime"
|
|
uses: crazy-max/ghaction-github-runtime@v1
|
|
|
|
- name: Prepare dagger
|
|
run: |
|
|
make dagger
|
|
cp ./cmd/dagger/dagger /usr/local/bin
|
|
|
|
- name: Lint
|
|
env:
|
|
DAGGER_CACHE_TO: "type=gha,mode=max,scope=dagger-ci-lint"
|
|
DAGGER_CACHE_FROM: "type=gha,scope=dagger-ci-lint"
|
|
run: |
|
|
cd ci
|
|
dagger do lint
|