Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

feature/COR-1684-fix-null-value-for-archived-reproduction-data #10209

feature/COR-1684-fix-null-value-for-archived-reproduction-data

feature/COR-1684-fix-null-value-for-archived-reproduction-data #10209

Workflow file for this run

name: Main
on: pull_request
jobs:
init:
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
lint:
runs-on: ubuntu-latest
needs: init
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Lookup cached node_modules
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: yarn install
- name: Lint code
run: yarn lint
compile:
runs-on: ubuntu-latest
needs: init
steps:
- name: Get target branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_BASE_REF} | tr / -)" >> $GITHUB_ENV
- name: Check out repository
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Lookup cached node_modules
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: yarn install
- name: Build icon package
run: yarn build:icons
- name: Build common module
run: yarn build:common
- name: Import texts (develop)
if: ${{ env.BRANCH_NAME != 'master' }}
run: yarn cms:lokalize-import --clean-json
- name: Import texts (production)
if: ${{ env.BRANCH_NAME == 'master' }}
run: yarn cms:lokalize-import:prd --clean-json
- name: Typecheck all code
run: yarn typecheck
test:
runs-on: ubuntu-latest
needs: init
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Lookup cached node_modules
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install packages
run: yarn install
- name: Build common module
run: yarn build:common
- name: Build icons module
run: yarn build:icons
- name: Export texts
run: yarn cms:lokalize-import --clean-json
- name: Run tests
run: yarn test:ci
docker:
runs-on: ubuntu-latest
needs: init
if: contains(github.head_ref, 'release')
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
uses: docker/build-push-action@v2
with:
build-args: |
"ARG_NEXT_PUBLIC_SANITY_PROJECT_ID=5mog5ask"
"SANITY_API_TOKEN=<sanity_token>"
"ARG_NEXT_PUBLIC_SANITY_DATASET=production"
"ARG_NEXT_PUBLIC_COMMIT_ID=local-test-random-string"
"ARG_API_URL=https://coronadashboard.rijksoverheid.nl/json/latest-data.zip"
push: false