-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
78 changed files
with
112 additions
and
33,457 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
on: | ||
pull_request: {} | ||
|
||
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@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- 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@v2 | ||
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.16', '1.17', '1.18', '1.19', '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' |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BUILD_OCI=false | ||
GOFLAGS=-mod=readonly |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
services: | ||
golang-devtools: | ||
build: | ||
context: docker-compose | ||
target: golang-devtools | ||
dockerfile: Dockerfile | ||
privileged: true | ||
security_opt: | ||
- seccomp:unconfined | ||
- apparmor:unconfined | ||
volumes: | ||
- .:/srv/workspace:z | ||
- ${DOCKER_CONFIG:-~/.docker}:/root/.docker | ||
- ${GIT_CONFIG:-~/.gitconfig}:${GIT_CONFIG_GUEST:-/root/.gitconfig} | ||
- ${SSH_CONFIG:-~/.ssh}:/root/.ssh | ||
- ${XDG_CACHE_HOME:-xdg-cache-home}:/root/.cache | ||
# ${x:-y} explained here https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#:~:text=3.5.3%20Shell%20Parameter%20Expansion | ||
environment: | ||
GOMODCACHE: /root/.cache/go-mod | ||
techdocs: | ||
build: | ||
context: docker-compose | ||
dockerfile: Dockerfile | ||
target: techdocs | ||
working_dir: /srv/workspace | ||
environment: | ||
GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS:-} | ||
GCLOUD_PROJECT: ${GCLOUD_PROJECT:-} | ||
volumes: | ||
- .:/srv/workspace:z | ||
- ${XDG_CACHE_HOME:-xdg-cache-home}:/root/.cache | ||
- $HOME/.config/gcloud:/root/.config/gcloud | ||
- ${GOOGLE_APPLICATION_CREDENTIALS:-nothing}:${GOOGLE_APPLICATION_CREDENTIALS:-/tmp/empty-GOOGLE_APPLICATION_CREDENTIALS} | ||
ports: | ||
- "127.0.0.1:3000:3000/tcp" | ||
- "127.0.0.1:8000:8000/tcp" | ||
command: serve | ||
volumes: | ||
xdg-cache-home: { } | ||
nothing: { } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM ghcr.io/coopnorge/engineering-docker-images/e0/devtools-golang-v1beta1:gitc-1f40b7aec2da97d51ed26c6f1d027bdee0458a0d@sha256:5abec21bdbd1fec9946a50e825692773a64e7db2ddd10d3446e1fc70cfcbca3b AS golang-devtools | ||
FROM ghcr.io/coopnorge/engineering-docker-images/e0/techdocs:gitc-520957c8b01583b35d335a49bc9d46428d3cfc5e@sha256:3c480d1f43b0dc4f46c041518c94c2c58a08406135a7250eb0d6ea70bc15b8f1 as techdocs |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.