Noop #209
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: LIPAS CI | |
on: [push] | |
env: | |
AUTH_KEY: ${{ vars.AUTH_KEY }} | |
ADMIN_PASSWORD: ${{ vars.ADMIN_PASSWORD }} | |
SMTP_HOST: ${{ vars.SMTP_HOST }} | |
SMTP_USER: ${{ vars.SMTP_USER }} | |
SMTP_FROM: ${{ vars.SMTP_FROM }} | |
SEARCH_HOST: ${{ vars.SEARCH_HOST }} | |
SEARCH_USER: ${{ vars.SEARCH_USER }} | |
SEARCH_PASS: ${{ vars.SEARCH_PASS}} | |
ES_JAVA_OPTS: ${{ vars.ES_JAVA_OPTS }} | |
DB_NAME: ${{ vars.DB_NAME }} | |
DB_HOST: ${{ vars.DB_HOST }} | |
DB_PORT: ${{ vars.DB_PORT }} | |
DB_SUPERUSER: ${{ vars.DB_SUPERUSER }} | |
DB_SUPERUSER_PASSWORD: ${{ vars.DB_SUPERUSER_PASSWORD }} | |
DB_USER: ${{ vars.DB_USER }} | |
DB_PASSWORD: ${{ vars.DB_PASSWORD }} | |
MML_AUTH: ${{ vars.MML_AUTH }} | |
OLD_LIPAS_URL: ${{ vars.OLD_LIPAS_URL }} | |
OLD_LIPAS_USER: ${{ vars.OLD_LIPAS_USER }} | |
OLD_LIPAS_PASS: ${{ vars.OLD_LIPAS_PASS }} | |
ACCESSIBILITY_REGISTER_BASE_URL: ${{ vars.ACCESSIBILITY_REGISTER_BASE_URL }} | |
ACCESSIBILITY_REGISTER_SYSTEM_ID: ${{ vars.ACCESSIBILITY_REGISTER_SYSTEM_ID }} | |
ACCESSIBILITY_REGISTER_SECRET_KEY: ${{ vars.ACCESSIBILITY_REGISTER_SECRET_KEY }} | |
LEGACY_DB_URL: ${{ vars.LEGACY_DB_URL }} | |
LEGACY_DB_USER: ${{ vars.LEGACY_DB_USER }} | |
LEGACY_DB_PASS: ${{ vars.LEGACY_DB_PASS }} | |
GEOSERVER_ADMIN_USER: ${{ vars.GEOSERVER_ADMIN_USER }} | |
GEOSERVER_ADMIN_PASSWORD: ${{ vars.GEOSERVER_ADMIN_PASSWORD }} | |
GEOSERVER_INITIAL_MEMORY: ${{ vars.GEOSERVER_INITIAL_MEMORY }} | |
GEOSERVER_MAX_MEMORY: ${{ vars.GEOSERVER_MAX_MEMORY}} | |
OSRM_CAR_URL: ${{ vars.OSRM_CAR_URL }} | |
OSRM_BICYCLE_URL: ${{ vars.OSRM_BICYCLE_URL }} | |
OSRM_FOOT_URL: ${{ vars.OSRM_FOOT_URL }} | |
MAILCHIMP_CAMPAIGN_FOLDER_ID: ${{ vars.MAILCHIMP_CAMPAIGN_FOLDER_ID }} | |
MAILCHIMP_LIST_ID: ${{ vars.MAILCHIMP_LIST_ID }} | |
MAILCHIMP_NEWSLETTER_INTEREST_ID: ${{ vars.MAILCHIMP_NEWSLETTER_INTEREST_ID }} | |
MAILCHIMP_API_URL: ${{ vars.MAILCHIMP_API_URL }} | |
MAILCHIMP_API_KEY: ${{ vars.MAILCHIMP_API_KEY }} | |
DIGITRANSIT_SUBSCRIPTION_KEY: ${{ vars.DIGITRANSIT_SUBSCRIPTION_KEY }} | |
MML_COVERAGE_URL: ${{ vars.MML_COVERAGE_URL }} | |
MML_API_KEY: ${{ vars.MML_API_KEY }} | |
AWS_ACCESS_KEY_ID: lol | |
AWS_SECRET_ACCESS_KEY: lol | |
AWS_REGION: 'eu-north-1' | |
AWS_S3_BUCKET: lol | |
AWS_S3_BUCKET_PREFIX: lol | |
LEIN_SILENT: true | |
jobs: | |
utp-schema-gen: | |
if: github.ref == 'refs/heads/ulkoilutietopalvelu' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install clojure tools | |
uses: DeLaGuardo/setup-clojure@11.0 | |
with: | |
lein: latest | |
- name: Cache clojure dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.m2/repository | |
~/.gitlibs | |
~/.deps.clj | |
# List all files containing dependencies: | |
# key: cljdeps-${{ hashFiles('deps.edn') }} | |
# key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }} | |
key: cljdeps-${{ hashFiles('webapp/project.clj') }} | |
# key: cljdeps-${{ hashFiles('build.boot') }} | |
restore-keys: cljdeps- | |
- name: Check if there are changes | |
id: changed-files | |
uses: tj-actions/changed-files@v40 | |
with: | |
files: | | |
webapp/src/cljc/lipas/data/activities.cljc | |
- name: Generate JSON schema | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: lein run -m lipas.data.activities > utp-schema.json | |
working-directory: ./webapp | |
- name: Generate CSV | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: lein run -m lipas.data.activities csv > utp-schema.csv | |
working-directory: ./webapp | |
- name: Deploy JSON schema to Gist | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: exuanbo/actions-deploy-gist@v1.1.4 | |
with: | |
token: ${{ secrets.UTP_SCHEMA_GIST_TOKEN }} | |
gist_id: ace43a7f66f7b14c526baab0f29c91d9 | |
file_path: webapp/utp-schema.json | |
file_type: text | |
- name: Deploy CSV to Gist | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: exuanbo/actions-deploy-gist@v1.1.4 | |
with: | |
token: ${{ secrets.UTP_SCHEMA_GIST_TOKEN }} | |
gist_id: 557991b8d68186e5ec4e88388a1c1741 | |
file_path: webapp/utp-schema.csv | |
file_type: text | |
ci: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install clojure tools | |
uses: DeLaGuardo/setup-clojure@11.0 | |
with: | |
# cli: latest | |
lein: latest | |
- name: Cache clojure dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.m2/repository | |
~/.gitlibs | |
~/.deps.clj | |
# List all files containing dependencies: | |
# key: cljdeps-${{ hashFiles('deps.edn') }} | |
# key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }} | |
key: cljdeps-${{ hashFiles('webapp/project.clj') }} | |
# key: cljdeps-${{ hashFiles('build.boot') }} | |
restore-keys: cljdeps- | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
cache-dependency-path: webapp/package-lock.json | |
- name: Run backend tests | |
run: docker-compose run --rm backend-tests | |
- name: Build backend jar | |
run: docker-compose run --rm backend-build | |
- name: Build frontend | |
run: | | |
npm install --quiet | |
npx shadow-cljs release app | |
working-directory: ./webapp | |
# - name: Install npm dependencies | |
# run: docker-compose run --rm frontend-npm-deps | |
# - name: Build frontend | |
# run: docker-compose run --rm frontend-build | |
# - name: Run backend migrations | |
# run: docker-compose run --rm backend-migrate | |
# - name: Seed backend data to db | |
# run: docker-compose run --rm backend-seed | |
# - name: Index backend data to ES | |
# run: docker-compose run --rm backend-index-search | |
# - name: Generate self-sigend SSL-certificate | |
# run: | | |
# openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 \ | |
# -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" \ | |
# -keyout certs/server.key -out certs/server.crt | |
# - name: Run integration tests | |
# run: docker-compose run --rm integration-tests | |
- name: docker logs | |
if: ${{ failure() }} | |
run: docker-compose logs |