-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.59 KB
/
cicd.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
---
on:
pull_request: {}
push:
branches:
- main
jobs:
go-ci:
name: Go CI
runs-on: ubuntu-latest
env:
docker-compose-service: golang-devtools
XDG_CACHE_HOME: ${{ github.workspace }}/.cache/xdg
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- id: xdg_cache_hash
run: echo "xdg_cache_hash=${{hashFiles('./docker-compose.yml', './docker-compose/Dockerfile', './go.sum')}}" >> $GITHUB_OUTPUT
- name: Cache xdg
uses: actions/cache@v4
with:
path: ${{ env.XDG_CACHE_HOME }}
key: xdg-${{ github.repository }}-${{ github.job }}-${{ steps.xdg_cache_hash.outputs.xdg_cache_hash }}
restore-keys: |
xdg-${{ github.repository }}-${{ github.job }}-${{ steps.xdg_cache_hash.outputs.xdg_cache_hash }}
xdg-${{ github.repository }}-${{ github.job }}-
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure access to internal and private GitHub repos
run: git config --global url."https://${{ secrets.REVIEWBOT_GITHUB_TOKEN }}:[email protected]/coopnorge".insteadOf "https://github.com/coopnorge"
- name: Build devtools
run: docker compose build
- name: Validate
run: docker compose run --rm ${{ env.docker-compose-service }} validate VERBOSE=all