chore: debug command #5
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: Generate test reports | |
on: | |
push: | |
branches: [chore/generate-test-report-action] | |
workflow_dispatch: | |
jobs: | |
generate_test_report: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set environment variables | |
run: | | |
echo "BRANCH_NAME=$(git branch --show-current)" >> $GITHUB_ENV | |
echo "COMMIT_MESSAGE=$(git log --format=%B -n 1 ${{github.event.after}} | head -n 1)" >> $GITHUB_ENV | |
echo "COMMIT_URL=${{github.event.head_commit.url}}" >> $GITHUB_ENV | |
echo "COMMITTER=${{github.event.head_commit.committer.name}}" >> $GITHUB_ENV | |
- name: Set TITLE | |
env: | |
PR_TITLE: ${{github.event.pull_request.title || env.COMMIT_MESSAGE}} | |
run: echo "TITLE=$PR_TITLE" >> $GITHUB_ENV | |
- name: Print environment variables | |
env: | |
GITHUB_CONTEXT: ${{toJson(github)}} | |
run: | | |
echo -e "BRANCH_NAME = ${BRANCH_NAME}" | |
echo -e "TITLE = ${TITLE}" | |
echo -e "COMMIT_MESSAGE = ${COMMIT_MESSAGE}" | |
echo -e "COMMIT_URL = ${COMMIT_URL}" | |
echo -e "COMMITTER = ${COMMITTER}" | |
echo -e "HOME = ${HOME}" | |
echo -e "GITHUB_CONTEXT = ${GITHUB_CONTEXT}" | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{github.token}} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
cache: 'yarn' | |
- name: Authenticate git clone | |
env: | |
GH_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}} | |
run: echo -e "machine github.com\n login ${GH_TOKEN}" > ~/.netrc | |
- name: Install JS dependencies | |
run: yarn --immutable | |
- name: Build | |
run: yarn dist | |
- name: Test | |
if: ${{ inputs.test }} | |
run: | | |
set -o pipefail | |
yarn test -- --coverage --coverage_reporters=lcov 2>&1 | tee ./unit-tests.log | |
- name: List files in directory | |
run: ls -la | |
- name: Save test coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: unit-tests.log |