Skip to content

Muutettu osoite uuteen maksut fronttiin #2577

Muutettu osoite uuteen maksut fronttiin

Muutettu osoite uuteen maksut fronttiin #2577

Workflow file for this run

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/docker-cache@0.5.0
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 $REGISTRY/utility/postgres:11
docker run -d --name ataru-test-redis -p 6380:6379 $REGISTRY/utility/redis:5.0
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 $REGISTRY/utility/postgres:11
docker run -d --name ataru-test-redis -p 6380:6379 $REGISTRY/utility/redis:5.0
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-uberjar
- 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 }}