feat: support for new speedtram type DT-5987 + DT-5988 + DT-5989 #903
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: Process v2 push or pr | |
on: | |
push: | |
branches: | |
- v2 | |
pull_request: | |
branches: | |
- v2 | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [10.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: "Set time zone to Europe/Helsinki" | |
uses: zcong1993/setup-timezone@master | |
with: | |
timezone: "Europe/Helsinki" | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: yarn | |
- name: Install dependencies and build shared components | |
run: yarn setup | |
- name: Run linters | |
run: yarn lint | |
unit-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [10.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: "Set time zone to Europe/Helsinki" | |
uses: zcong1993/setup-timezone@master | |
with: | |
timezone: "Europe/Helsinki" | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: yarn | |
- name: Install dependencies and build shared components | |
run: yarn setup | |
- name: build relay queries | |
run: yarn relay | |
- name: Run unit tests | |
run: yarn run test-coverage | |
- name: Send test coverage report | |
run: yarn run test-report | |
# build: | |
# needs: install | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# node-version: [10.x] | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# - name: "Set time zone to Europe/Helsinki" | |
# uses: zcong1993/setup-timezone@master | |
# with: | |
# timezone: "Europe/Helsinki" | |
# - name: Use Node.js ${{ matrix.node-version }} | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: ${{ matrix.node-version }} | |
# - name: Build shared components | |
# run: yarn setup | |
# - name: Build UI | |
# run: yarn build | |
# - name: Cache build | |
# id: cache-build | |
# uses: actions/cache@v2 | |
# with: | |
# path: | | |
# '**/_static' | |
# './manifest.json' | |
# key: ${{ runner.os }}-build-${{ github.run_id }} | |
publish-npm: | |
if: github.ref == 'refs/heads/v2' | |
needs: | |
- lint | |
- unit-test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 10.x ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set time zone to Europe/Helsinki | |
uses: zcong1993/setup-timezone@master | |
with: | |
timezone: "Europe/Helsinki" | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: yarn | |
- name: Install dependencies and build shared components | |
run: yarn setup | |
- name: build relay queries | |
run: yarn relay | |
- name: Authenticate with registry | |
run: echo //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} > .npmrc | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
- name: disregard changed yarn.lock | |
run: git update-index --assume-unchanged yarn.lock | |
- name: Publish shared components to npm | |
run: echo "publish-logs=$(yarn digitransit-npm-autopublish)" >> $GITHUB_OUTPUT | |
shell: bash | |
id: publish | |
- name: Parse publish logs | |
run: echo "published-packages=$(echo "${{ steps.publish.outputs.publish-logs }}" | grep -o -P '(Successfully published:).*')" >> $GITHUB_OUTPUT | |
shell: bash | |
id: log-parse | |
- name: Send published packages to slack | |
if: steps.log-parse.outputs.published-packages != '' | |
run: ./.github/workflows/scripts/slack_message.sh | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
PUBLISHED_PACKAGES: ${{ steps.log-parse.outputs.published-packages }} | |
shell: bash | |
docker-push: | |
if: github.ref == 'refs/heads/v2' | |
needs: | |
- lint | |
- publish-npm | |
- unit-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set time zone to Europe/Helsinki | |
uses: zcong1993/setup-timezone@master | |
with: | |
timezone: "Europe/Helsinki" | |
- name: Build docker image from v2 and push it | |
run: ./.github/workflows/scripts/build_and_push_dev.sh | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_AUTH: ${{ secrets.DOCKER_AUTH }} |