DOC: Creating step by step guide to update our forked repository with… #16
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: Frontend | |
on: | |
push: | |
branches: | |
- "master" | |
- "release-**" | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
files-changed: | |
name: Check which files changed | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 3 | |
outputs: | |
frontend_all: ${{ steps.changes.outputs.frontend_all }} | |
e2e_specs: ${{ steps.changes.outputs.e2e_specs }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test which files changed | |
uses: dorny/paths-filter@v2.11.1 | |
id: changes | |
with: | |
token: ${{ github.token }} | |
filters: .github/file-paths.yaml | |
fe-lint: | |
needs: files-changed | |
if: needs.files-changed.outputs.frontend_all == 'true' || needs.files-changed.outputs.e2e_specs == 'true' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare front-end environment | |
uses: ./.github/actions/prepare-frontend | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: "cljs" | |
- name: Compile CLJS | |
run: yarn build-pure:cljs | |
- name: Run Prettier formatting linter | |
run: yarn run lint-prettier-pure | |
- name: Run ESLint linter | |
run: yarn run lint-eslint-pure | |
fe-type-check: | |
needs: files-changed | |
if: needs.files-changed.outputs.frontend_all == 'true' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare front-end environment | |
uses: ./.github/actions/prepare-frontend | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: "cljs" | |
- run: yarn build-pure:cljs | |
name: Compile CLJS | |
- run: yarn type-check-pure | |
name: Check types | |
fe-tests-unit: | |
needs: files-changed | |
if: github.event.pull_request.draft == false && needs.files-changed.outputs.frontend_all == 'true' | |
runs-on: buildjet-2vcpu-ubuntu-2204 | |
timeout-minutes: 60 | |
env: | |
JEST_JUNIT_OUTPUT_DIR: ./target/junit | |
JEST_JUNIT_OUTPUT_NAME: test-report-frontend-unit.xml | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare front-end environment | |
uses: ./.github/actions/prepare-frontend | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: "cljs" | |
- name: Run frontend unit tests and collect the code coverage information | |
if: github.ref_name == 'master' | |
run: yarn run test-unit --coverage --silent | |
- name: Run frontend unit tests | |
if: github.ref_name != 'master' | |
run: yarn run test-unit --silent | |
- name: Upload coverage to codecov.io | |
if: github.ref_name == 'master' | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage/lcov.info | |
flags: front-end | |
- name: Upload Test Results | |
uses: ./.github/actions/upload-test-results | |
if: always() | |
with: | |
input-path: ./target/junit | |
output-name: frontend-unit | |
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }} | |
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ vars.AWS_REGION }} | |
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }} | |
fe-tests-timezones: | |
needs: files-changed | |
if: github.event.pull_request.draft == false && needs.files-changed.outputs.frontend_all == 'true' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare front-end environment | |
uses: ./.github/actions/prepare-frontend | |
- name: Prepare back-end environment | |
uses: ./.github/actions/prepare-backend | |
with: | |
m2-cache-key: "cljs" | |
- name: Run frontend timezones tests | |
run: yarn run test-timezones |