-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (77 loc) · 2.85 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
on:
pull_request: {}
push:
branches:
- main
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
run-golang-ci: ${{ steps.changes.outputs.golang == 'true' }}
run-pallet-ci: ${{ steps.changes.outputs.pallet == 'true' }}
steps:
- uses: actions/checkout@v4
- id: xdg_cache_hash
run: echo "xdg_cache_hash=${{hashFiles('./docker-compose.yml', './docker-compose/Dockerfile', './**/go.sum')}}" >> $GITHUB_OUTPUT
- uses: dorny/paths-filter@v2
id: changes
with:
list-files: json
filters: |
golang:
- '!./pallet'
pallet:
- './pallet'
- name: Debug ...
run: |
echo "::${{ steps.changes.outputs }}"
go-ci:
name: Go CI
needs: ["setup"]
if: ${{ steps.setup.output.run-golang-ci == 'true' }}
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@v3
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
pallet-ci:
name: Pallet CI
if: ${{ steps.setup.output.run-pallet-ci == 'true' }}
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-pallet-ci-${{ github.ref }}
cancel-in-progress: true
needs: ["setup"]
uses: coopnorge/github-workflow-kubernetes-validation/.github/workflows/kubernetes-validation.yaml@c019380575504edcba517bb7ad68a0bd8a960c2f
with:
do-argocd-diff: false
secrets:
argocd-api-token: ${{ secrets.ARGOCD_API_TOKEN }}