OPHYK-401 Amend test fixture since aidinkieli and asiointikieli can b… #63
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: oppijanumerorekisteri | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build-oppijanumerorekisteri: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:12.14 | |
ports: | |
- 5435:5432 | |
env: | |
POSTGRES_USER: oph | |
POSTGRES_DB: oppijanumerorekisteri | |
POSTGRES_PASSWORD: oph | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "corretto" | |
cache: "maven" | |
- name: Maven version | |
run: ./mvnw --version | |
- name: Build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./mvnw clean install -B -Dbranch=$GITHUB_REF_NAME -Drevision=$GITHUB_SHA -DbuildNumber=$GITHUB_RUN_NUMBER/$GITHUB_RUN_ATTEMPT | |
- name: Upload jar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: oppijanumerorekisteri-jar | |
path: oppijanumerorekisteri-service/target/oppijanumerorekisteri-service-*SNAPSHOT.jar | |
deploy-oppijanumerorekisteri-container: | |
needs: [build-oppijanumerorekisteri] | |
uses: Opetushallitus/.github/.github/workflows/push-scan-java-ecr.yml@main | |
with: | |
application: oppijanumerorekisteri | |
base-image: baseimage-fatjar-openjdk21:master | |
configfolder: oppijanumerorekisteri-service/src/main/resources/config | |
jarfile: oppijanumerorekisteri-service-*SNAPSHOT | |
jarfolder: . | |
type: jar | |
download-artifact: true | |
download-artifact-name: oppijanumerorekisteri-jar | |
secrets: | |
AWS_UTILITY_ROLE_ARN: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} | |
deploy-oppijanumerorekisteri-artifacts: | |
needs: [build-oppijanumerorekisteri] | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
cache: 'maven' | |
- name: Maven version | |
run: ./mvnw --version | |
- name: Deploy | |
env: | |
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | |
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | |
run: | | |
git clone https://github.com/Opetushallitus/ci-tools.git | |
source ci-tools/common/setup-tools.sh | |
./mvnw deploy -pl oppijanumerorekisteri-api -am -DskipTests --settings ci-tools/common/maven-settings.xml | |
build-henkilo-ui: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "corretto" | |
cache: "maven" | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
cache-dependency-path: henkilo-ui/src/main/static/package-lock.json | |
- name: Cache playwright browsers | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ms-playwright | |
key: ${{ runner.os }}-pw-browsers | |
restore-keys: ${{ runner.os }}-pw-browsers | |
- name: Build frontend | |
working-directory: henkilo-ui/src/main/static | |
run: | | |
npm ci | |
npm run lint | |
npm run prettier | |
npm run e2e:install-deps | |
CI=true npm run e2e:ci | |
npm run build | |
- name: Upload e2e test artifact | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-results | |
path: henkilo-ui/src/main/static/playwright-results | |
retention-days: 10 | |
- name: Build backend | |
working-directory: henkilo-ui | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: mvn clean install -B -Dbranch=$GITHUB_REF_NAME -Drevision=$GITHUB_SHA -DbuildNumber=$GITHUB_RUN_NUMBER/$GITHUB_RUN_ATTEMPT |