ci: use dagger from source

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2022-03-31 19:33:07 -07:00
parent b989c5d661
commit 8fe29cdc76

View File

@ -4,40 +4,84 @@ on:
push: push:
branches: [main] branches: [main]
paths: paths:
- '**.sh' - "**.sh"
- '**.bash' - "**.bash"
- '**.go' - "**.go"
- '**.cue' - "**.cue"
- '**.bats' - "**.bats"
- 'Makefile' - "Makefile"
- 'go.mod' - "go.mod"
- 'go.sum' - "go.sum"
- '.github/workflows/dagger-ci.yml' - ".github/workflows/dagger-ci.yml"
pull_request: pull_request:
branches: [main] branches: [main]
paths: paths:
- '**.sh' - "**.sh"
- '**.bash' - "**.bash"
- '**.go' - "**.go"
- '**.cue' - "**.cue"
- '**.bats' - "**.bats"
- 'Makefile' - "Makefile"
- 'go.mod' - "go.mod"
- 'go.sum' - "go.sum"
- '.github/workflows/dagger-ci.yml' - ".github/workflows/dagger-ci.yml"
env: env:
DAGGER_LOG_FORMAT: plain DAGGER_LOG_FORMAT: plain
jobs: jobs:
build: build:
name: "Build"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Dagger CI - name: "Setup Go"
uses: dagger/dagger-for-github@v2 uses: actions/setup-go@v1
with: with:
workdir: ci go-version: 1.16
args: do build
- 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