.github/workflows/test.yml
name: Test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: '21'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
./node_modules
~/.cache/Cypress
- uses: browser-actions/setup-chrome@latest
- name: Install essential tools
run: |
curl -o ../cc-test-reporter \
-L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod u+x ../cc-test-reporter
- name: Install Dependencies
run: pnpm i -s
- name: Lint
run: pnpm run lint
- name: Test
run: |
export GIT_COMMITTED_AT=$(date +%s)
export GIT_BRANCH=${{ github.ref_name }}
export CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }}
../cc-test-reporter before-build
pnpm run test --no-progress --browsers ChromeHeadlessNoSandbox
../cc-test-reporter after-build -t lcov --exit-code ${?} ./coverage/lconv.info
env:
GIT_COMMIT_SHA: ${{ github.sha }}
CI_NAME: "Github Action"
CI_BUILD_ID: ${{ github.run_number }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Check cypress binary
run: |
if [ ! -d ~/.cache/Cypress ]; then
pnpm run cypress:install
fi
- name: e2e
run: |
export CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }}
pnpm run e2e