Bump coopnorge/engineering-docker-images/e0/devtools-golang-v1beta1 from 5abec21
to 732a7ad
in /docker-compose
#57
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI/CD | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- main | |
jobs: | |
golang-ci: | |
name: Go Lang 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@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 | |
validate-old-go: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: [ '1.20', '1.21' ] | |
name: Go ${{ matrix.go }} - validate | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install toolchain | |
run: make toolchain | |
- name: Validate | |
run: make validate | |
build: | |
needs: | |
- golang-ci | |
- validate-old-go | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- run: exit 1 | |
name: "Catch errors" | |
if: | | |
needs.golang-ci.result == 'failure' || | |
needs.validate-old-go.result == 'failure' |