This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
59 lines (51 loc) · 1.59 KB
/
lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Continuous Integration
on:
push:
paths:
- "**.go"
- "**.cue"
- ".github/workflows/lint.yaml"
- "go.mod"
- "go.sum"
- ".golangci.yaml"
branches:
- main
pull_request:
paths:
- "**.go"
- "**.cue"
- ".github/workflows/lint.yaml"
- "go.mod"
- "go.sum"
- ".golangci.yaml"
branches:
- main
env:
DAGGER_LOG_FORMAT: plain
jobs:
lint:
name: "Linter"
runs-on: ubuntu-latest
env:
DAGGER_CACHE_BASE: "ci-lint"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: "Expose GitHub Runtime"
uses: crazy-max/ghaction-github-runtime@v1
- name: "Set up dagger"
uses: dagger/dagger-for-github@v3
with:
install-only: true
- name: Sets env vars on push to main
run: |
echo "DAGGER_CACHE_TO=type=gha,mode=max,scope=${{env.DAGGER_CACHE_BASE}}-main" >> $GITHUB_ENV
echo "DAGGER_CACHE_FROM=type=gha,scope=${{env.DAGGER_CACHE_BASE}}-main" >> $GITHUB_ENV
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- name: Sets env vars on pull request
run: |
echo "DAGGER_CACHE_TO=type=gha,mode=max,scope=${{env.DAGGER_CACHE_BASE}}-${{github.event.number}}" >> $GITHUB_ENV
echo "DAGGER_CACHE_FROM=type=gha,scope=${{env.DAGGER_CACHE_BASE}}-main type=gha,scope=${{env.DAGGER_CACHE_BASE}}-${{github.event.number}}" >> $GITHUB_ENV
if: ${{ github.event_name == 'pull_request' }}
- name: Run linter
run: dagger project update && dagger do lint