EP-4411 #1562
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: Eperusteet-frontend-utils build | |
on: [workflow_dispatch, push] | |
jobs: | |
build-and-test-eperusteet-frontend-utils: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node 21 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '21.7.3' | |
- name: Enable corepack for nodejs | |
run: corepack enable | |
- name: Get backend eperusteet branch file http status | |
id: spec_file_http_status_eperusteet | |
run: | | |
if [ "$(curl -s -o /dev/null -I -w '%{http_code}' https://raw.githubusercontent.com/Opetushallitus/eperusteet/${{ github.ref_name }}/generated/eperusteet.spec.json)" == "200" ] | |
then | |
echo spec file found | |
echo "EPERUSTEET_SPECFILE=https://raw.githubusercontent.com/Opetushallitus/eperusteet/${{ github.ref_name }}/generated/eperusteet.spec.json" >> $GITHUB_ENV | |
else | |
echo spec file not found | |
fi | |
- name: Get backend eperusteet-amosaa branch file http status | |
id: spec_file_http_status_amosaa | |
run: | | |
if [ "$(curl -s -o /dev/null -I -w '%{http_code}' https://raw.githubusercontent.com/Opetushallitus/eperusteet-amosaa/${{ github.ref_name }}/generated/amosaa.spec.json)" == "200" ] | |
then | |
echo spec file found | |
echo "EPERUSTEET_AMOSAA_SPECFILE=https://raw.githubusercontent.com/Opetushallitus/eperusteet-amosaa/${{ github.ref_name }}/generated/amosaa.spec.json" >> $GITHUB_ENV | |
else | |
echo spec file not found | |
fi | |
- name: Get backend eperusteet-ylops branch file http status | |
id: spec_file_http_status_ylops | |
run: | | |
if [ "$(curl -s -o /dev/null -I -w '%{http_code}' https://raw.githubusercontent.com/Opetushallitus/eperusteet-ylops/${{ github.ref_name }}/generated/ylops.spec.json)" == "200" ] | |
then | |
echo spec file found | |
echo "EPERUSTEET_YLOPS_SPECFILE=https://raw.githubusercontent.com/Opetushallitus/eperusteet-ylops/${{ github.ref_name }}/generated/ylops.spec.json" >> $GITHUB_ENV | |
else | |
echo spec file not found | |
fi | |
- name: Build eperusteet-frontend-utils | |
run: | | |
cd vue | |
yarn install --silent | |
yarn gen:api | |
yarn lint | |
yarn test:unit |