Skip to content

Nav 23517 validere saksbehandler opp mot enhet #1828

Nav 23517 validere saksbehandler opp mot enhet

Nav 23517 validere saksbehandler opp mot enhet #1828

Workflow file for this run

name: Build
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
ktlint:
name: Ktlint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Kjør ktlint
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn -B --no-transfer-progress antrun:run@ktlint --settings .m2/maven-settings.xml
build-jar-docker:
if: github.event.pull_request.draft == false
name: Bygg app/image, push til github
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Bygg med maven u/test
env:
SONAR_PROJECTKEY: ${{ secrets.SONAR_PROJECTKEY }}
SONAR_LOGIN: ${{ secrets.SONAR_LOGIN }}
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B --no-transfer-progress package verify -Dmaven.test.skip=true --settings .m2/maven-settings.xml -DtrimStackTrace=false --file pom.xml -Dchangelist= -Dsha1=-$TIMESTAMP-$(echo $GITHUB_SHA | cut -c1-7)
- uses: nais/docker-build-push@v0
id: docker-push
if: github.event.pull_request.user.login != 'dependabot[bot]'
with:
team: teamfamilie
push_image: true
tag: ${{ github.sha }}
dockerfile: Dockerfile
docker_context: .
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
outputs:
image: ${{ steps.docker-push.outputs.image }}
run-junit:
if: github.event.pull_request.draft == false
name: Kjøre junit tester
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- name: Bygg med maven
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --version && mvn -B --no-transfer-progress verify --settings .m2/maven-settings.xml --file pom.xml
run-e2e:
if: github.event.pull_request.draft == false && github.event.pull_request.user.login != 'dependabot[bot]'
name: Kjør e2e tester
runs-on: ubuntu-latest
needs: build-jar-docker
permissions:
contents: "read"
id-token: "write"
steps:
- name: Login GAR
uses: nais/login@v0
with:
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
team: teamfamilie
- name: Checkout e2e tests
if: "!contains(github.event.head_commit.message, 'e2e skip')"
uses: actions/checkout@v4
with:
ref: "main"
repository: navikt/familie-tilbake-e2e
token: ${{ secrets.READER_TOKEN }}
path: tilbake-e2e
- name: Setter riktig familie-tilbake versjon i e2e tester hvis e2e bruker ghcr.io(deprecated)
if: "!contains(github.event.head_commit.message, 'e2e skip')"
run: sed -i 's/ghcr.io\/navikt\/familie-tilbake:latest/europe-north1-docker.pkg.dev\/nais-management-233d\/teamfamilie\/familie-tilbake:${{ github.sha }}/g' tilbake-e2e/e2e/docker-compose.yml
- name: Setter riktig familie-tilbake versjon i e2e tester
if: "!contains(github.event.head_commit.message, 'e2e skip')"
run: sed -i 's/europe-north1-docker.pkg.dev\/nais-management-233d\/teamfamilie\/familie-tilbake:latest/europe-north1-docker.pkg.dev\/nais-management-233d\/teamfamilie\/familie-tilbake:${{ github.sha }}/g' tilbake-e2e/e2e/docker-compose.yml
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Start alle apper (e2e)
env:
INTEGRASJONER_CLIENT_ID: ${{ secrets.INTEGRASJONER_CLIENT_ID }}
INTEGRASJONER_CLIENT_SECRET: ${{ secrets.INTEGRASJONER_CLIENT_SECRET }}
INTEGRASJONER_INFOTRYGD_KS_SCOPE: ${{ secrets.INTEGRASJONER_INFOTRYGD_KS_SCOPE }}
INTEGRASJONER_AAD_GRAPH_SCOPE: ${{ secrets.INTEGRASJONER_AAD_GRAPH_SCOPE }}
TILBAKE_CLIENT_ID: ${{ secrets.TILBAKE_CLIENT_ID }}
TILBAKE_CLIENT_SECRET: ${{ secrets.TILBAKE_CLIENT_SECRET }}
TILBAKE_FRONTEND_CLIENT_ID: ${{ secrets.TILBAKE_FRONTEND_CLIENT_ID }}
INTEGRASJONER_SCOPE: ${{ secrets.INTEGRASJONER_SCOPE }}
HISTORIKK_CLIENT_ID: ${{ secrets.HISTORIKK_CLIENT_ID }}
HISTORIKK_CLIENT_SECRET: ${{ secrets.HISTORIKK_CLIENT_SECRET }}
if: "!contains(github.event.head_commit.message, 'e2e skip')"
run: cd tilbake-e2e/e2e; ./e2e.sh
- name: Kjør tester (e2e)
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TILBAKE_CLIENT_ID: ${{ secrets.TILBAKE_CLIENT_ID }}
TILBAKE_CLIENT_SECRET: ${{ secrets.TILBAKE_CLIENT_SECRET }}
HISTORIKK_CLIENT_ID: ${{ secrets.HISTORIKK_CLIENT_ID }}
HISTORIKK_CLIENT_SECRET: ${{ secrets.HISTORIKK_CLIENT_SECRET }}
if: "!contains(github.event.head_commit.message, 'e2e skip')"
run: cd tilbake-e2e/autotest; mvn -B --no-transfer-progress --settings .m2/maven-settings.xml -Dtest="**" test
- name: Samle Docker-logs ved feil
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
dest: './logs'
- name: Tar logs
if: failure()
run: tar cvzf ./logs.tgz ./logs
- name: Laste opp logs til GitHub
uses: actions/upload-artifact@master
if: failure()
with:
name: docker-logs-${{ github.run_number }}.tgz
path: ./logs.tgz
retention-days: 2