From 7c14791d8d18ddd2f66ebd8b897845f16c75f85f Mon Sep 17 00:00:00 2001 From: kevkevin Date: Fri, 10 Nov 2023 15:21:00 -0600 Subject: [PATCH] initial jest testing (#924) * initial jest testing * add to git actions * testing to see if this fixes our craco tests * testing to see if this fixes our craco tests * fix exports of helpers * added configs for both jest and craco to use * seperated workflows and renamed them to be clearer --- .github/workflows/prjob_build.yml | 17 +++++++++ .github/workflows/prjob_eslint.yml | 17 +++++++++ .github/workflows/prjob_prettier.yml | 18 ++++++++++ .github/workflows/prjob_tests.yml | 34 ++++++++++++++++++ .github/workflows/pull_request.yml | 54 ---------------------------- 5 files changed, 86 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/prjob_build.yml create mode 100644 .github/workflows/prjob_eslint.yml create mode 100644 .github/workflows/prjob_prettier.yml create mode 100644 .github/workflows/prjob_tests.yml delete mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/prjob_build.yml b/.github/workflows/prjob_build.yml new file mode 100644 index 000000000..e7aa1f9c5 --- /dev/null +++ b/.github/workflows/prjob_build.yml @@ -0,0 +1,17 @@ +name: Build +on: + pull_request: + branches: + - master +jobs: + build: + name: build + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: yarn --cwd ./frontend/app install + - name: Build + run: CI=false yarn --cwd ./frontend/app run build + diff --git a/.github/workflows/prjob_eslint.yml b/.github/workflows/prjob_eslint.yml new file mode 100644 index 000000000..8f3247933 --- /dev/null +++ b/.github/workflows/prjob_eslint.yml @@ -0,0 +1,17 @@ +name: Eslint +on: + pull_request: + branches: + - master +jobs: + eslint: + name: eslint + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: yarn --cwd ./frontend/app install + - name: Eslint + run: yarn --cwd ./frontend/app run lint + diff --git a/.github/workflows/prjob_prettier.yml b/.github/workflows/prjob_prettier.yml new file mode 100644 index 000000000..bfd1431dd --- /dev/null +++ b/.github/workflows/prjob_prettier.yml @@ -0,0 +1,18 @@ +name: Prettier +on: + pull_request: + branches: + - master +jobs: + + prettier: + name: prettier + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: yarn --cwd ./frontend/app install + - name: Prettier + run: CI=false yarn --cwd ./frontend/app run prettier:check + diff --git a/.github/workflows/prjob_tests.yml b/.github/workflows/prjob_tests.yml new file mode 100644 index 000000000..db7bb1c6c --- /dev/null +++ b/.github/workflows/prjob_tests.yml @@ -0,0 +1,34 @@ +name: Tests +on: + pull_request: + branches: + - master +jobs: + test: + name: Craco + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: yarn --cwd ./frontend/app install + - name: Tests + run: NODE_OPTIONS="--max_old_space_size=8192" yarn --cwd ./frontend/app run test + - name: Set up Golang + uses: actions/setup-go@v2 + with: + go-version: 1.19 + - name: Go Test + run: go test -v ./... + + test-jest: + name: Jest + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: yarn --cwd ./frontend/app install + - name: Tests + run: NODE_OPTIONS="--max_old_space_size=8192" yarn --cwd ./frontend/app run test-jest + diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 869aa9776..000000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: PRCheck -on: - pull_request: - branches: - - master -jobs: - eslint: - name: ESLint Job - runs-on: - - ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: yarn --cwd ./frontend/app install - - name: Eslint - run: yarn --cwd ./frontend/app run lint - test: - name: Test Job - runs-on: - - ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: yarn --cwd ./frontend/app install - - name: Tests - run: NODE_OPTIONS="--max_old_space_size=8192" yarn --cwd ./frontend/app run test - - name: Set up Golang - uses: actions/setup-go@v2 - with: - go-version: 1.19 - - name: Go Test - run: go test -v ./... - - build: - name: Build Job - runs-on: - - ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: yarn --cwd ./frontend/app install - - name: Build - run: CI=false yarn --cwd ./frontend/app run build - - prettier: - name: Prettier Job - runs-on: - - ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: yarn --cwd ./frontend/app install - - name: Prettier - run: CI=false yarn --cwd ./frontend/app run prettier:check