OK-710: Working end-to-end -logic for adding koski-tutkinnot to appli… #2862
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: Ataru | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- '**.md' | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
HUSKY: 0 | |
jobs: | |
test-integration: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/prepare-clojure-env | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} | |
aws-region: eu-west-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: Cache Docker images | |
uses: ScribeMD/[email protected] | |
with: | |
key: docker-${{ runner.os }}-${{ hashFiles('**/workflows/build.yml', '**/Dockerfile', '**/docker-compose.yml') }} | |
- name: Npm ci | |
run: npm ci | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV | |
- name: Cache playwright binaries | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: ~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- run: npx playwright install --with-deps chromium | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- name: Prepare tests | |
env: | |
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
GA_BUILD_NUMBER: ${{ github.run_number }} | |
run: | | |
git clone https://github.com/Opetushallitus/ci-tools.git | |
source ci-tools/common/setup-tools.sh | |
docker run -d --name ataru-test-db -p 5433:5432 -e POSTGRES_DB=ataru-test -e POSTGRES_PASSWORD=oph -e POSTGRES_USER=oph $(docker build -f ./test-postgres/Dockerfile --build-arg POSTGRESQL_VERSION=15 -q .) | |
docker run -d --name ataru-test-redis -p 6380:6379 $REGISTRY/ecr-public/docker/library/redis:7 | |
docker run -d --name ataru-test-ftpd -p 2221:21 -p 30000-30009:30000-30009 $REGISTRY/utility/hiekkalaatikko:ataru-test-ftpd | |
- name: Run integration tests (Cypress & Playwright) | |
run: | | |
./bin/cibuild.sh run-browser-tests-integration | |
test-spec-and-mocha: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/prepare-clojure-env | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} | |
aws-region: eu-west-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: Prepare tests | |
env: | |
REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
GA_BUILD_NUMBER: ${{ github.run_number }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y lftp | |
git clone https://github.com/Opetushallitus/ci-tools.git | |
source ci-tools/common/setup-tools.sh | |
docker run -d --name ataru-test-db -p 5433:5432 -e POSTGRES_DB=ataru-test -e POSTGRES_PASSWORD=oph -e POSTGRES_USER=oph $(docker build -f ./test-postgres/Dockerfile --build-arg POSTGRESQL_VERSION=15 -q .) | |
docker run -d --name ataru-test-redis -p 6380:6379 $REGISTRY/ecr-public/docker/library/redis:7 | |
docker run -d --name ataru-test-ftpd -p 2221:21 -p 30000-30009:30000-30009 $REGISTRY/utility/hiekkalaatikko:ataru-test-ftpd | |
- name: Run Spec and Mocha tests | |
run: | | |
./bin/cibuild.sh run-spec-and-mocha-tests | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/prepare-clojure-env | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: Build | |
run: ./bin/cibuild.sh create-both-uberjars | |
- uses: actions/cache@v4 | |
id: restore-build | |
with: | |
path: target | |
key: ${{ github.sha }} | |
build-and-deploy-ataru-hakija: | |
needs: [test-integration, test-spec-and-mocha, build] | |
uses: Opetushallitus/.github/.github/workflows/push-scan-java-ecr.yml@main | |
with: | |
application: ataru-hakija | |
base-image: baseimage-fatjar-openjdk17:master | |
configfolder: oph-configuration | |
jarfile: ataru | |
secrets: | |
AWS_UTILITY_ROLE_ARN: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} | |
build-and-deploy-ataru-editori: | |
needs: [test-integration, test-spec-and-mocha, build] | |
uses: Opetushallitus/.github/.github/workflows/push-scan-java-ecr.yml@main | |
with: | |
application: ataru-editori | |
base-image: baseimage-fatjar-openjdk17:master | |
configfolder: oph-configuration | |
jarfile: ataru | |
secrets: | |
AWS_UTILITY_ROLE_ARN: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} | |
build-and-deploy-ovara-ataru: | |
needs: [test-integration, test-spec-and-mocha, build] | |
uses: Opetushallitus/.github/.github/workflows/push-scan-java-ecr.yml@main | |
with: | |
application: ovara-ataru | |
base-image: baseimage-fatjar-openjdk17:master | |
configfolder: ovara-configuration | |
jarfile: ovara-ataru | |
secrets: | |
AWS_UTILITY_ROLE_ARN: ${{ secrets.AWS_OPH_UTILITY_ROLE_ARN }} |