Use Bun as package manager #7756
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: Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * 0' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: depot-ubuntu-22.04-16 | |
# Use cheaper machines for dependabot if we're low on namespace credits | |
# runs-on: ${{ github.actor == 'dependabot[bot]' && 'namespace-profile-frontend-light' || 'namespace-profile-frontend' }} | |
permissions: write-all | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
# - uses: actions/setup-node@v3 | |
# with: | |
# node-version: '18' | |
# cache: 'npm' | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: 1.0.x | |
no-cache: true | |
- run: bun install | |
# - run: npm ci --prefer-offline --ignore-scripts --no-audit --no-fund | |
- id: compute_percy_enable_for_branch | |
run: echo "::set-output name=percy_enable::true" | |
if: "github.ref == 'refs/heads/master'" | |
- id: compute_percy_enable_for_commit | |
run: echo "::set-output name=percy_enable::true" | |
if: "contains(github.event.head_commit.message, '[percy]')" | |
- id: compute_percy_enable | |
run: echo "::set-output name=percy_enable::true" | |
if: steps.compute_percy_enable_for_branch.outputs.percy_enable == 'true' || steps.compute_percy_enable_for_commit.outputs.percy_enable == 'true' | |
- run: bun run ember --version | |
- run: bun run percy --version | |
- run: bun run tailwind:build | |
- run: bun run percy exec --quiet -- bun run ember exam --silent --reporter=xunit --parallel=16 --load-balance --preserve-test-name | tee test-results.xml >/dev/null 2>&1 | |
env: | |
COVERAGE: true | |
PERCY_ENABLE: ${{steps.compute_percy_enable.outputs.percy_enable || '0'}} | |
PERCY_TOKEN: ${{secrets.PERCY_TOKEN}} | |
- run: cat test-results.xml | |
if: always() | |
- name: 'Upload coverage to Codecov' | |
uses: codecov/codecov-action@v1 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# - name: Remove percy logs | |
# run: sed -i '/^\[percy\]/d' test-results.xml | |
- name: Remove sentry-webpack-plugin logs | |
run: sed -i '/^\[sentry-webpack-plugin\]/d' test-results.xml | |
- run: cat test-results.xml | |
- name: Publish Buildkite analytics | |
continue-on-error: true | |
run: |- | |
curl -XPOST --fail \ | |
-H "Authorization: Token token=\"$BUILDKITE_ANALYTICS_TOKEN\"" \ | |
-F "[email protected]" \ | |
-F "format=junit" \ | |
-F "run_env[CI]=github_actions" \ | |
-F "run_env[key]=$GITHUB_ACTION-$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" \ | |
-F "run_env[number]=$GITHUB_RUN_NUMBER" \ | |
-F "run_env[branch]=$GITHUB_REF" \ | |
-F "run_env[commit_sha]=$GITHUB_SHA" \ | |
-F "run_env[url]=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ | |
https://analytics-api.buildkite.com/v1/uploads | |
if: always() | |
env: | |
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_ANALYTICS_TOKEN }} | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: test-results.xml | |
seconds_between_github_writes: 0.01 | |
seconds_between_github_reads: 0.01 | |
lint: | |
runs-on: depot-ubuntu-22.04-16 | |
# Use cheaper machines for dependabot if we're low on namespace credits | |
# runs-on: ${{ github.actor == 'dependabot[bot]' && 'namespace-profile-frontend-light' || 'namespace-profile-frontend' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: 1.0.x | |
no-cache: true | |
- run: bun install | |
- run: bun run tailwind:build | |
- run: bun run lint |