migrate events atoms to reatom3 #3346
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: build | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'release-*' | |
paths-ignore: | |
- 'e2e/**' | |
- 'playwright.config.ts' | |
- '.github/workflows/run_e2e_tests.yml' | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- ready_for_review | |
- synchronize | |
# paths-ignore: | |
# - 'e2e/**' | |
# - 'playwright.config.ts' | |
# - '.github/workflows/run_e2e_tests.yml' | |
workflow_dispatch: | |
env: | |
NODE_ENV: production | |
AVA_FORCE_CI: 'not-ci' | |
REGISTRY: ghcr.io | |
IMAGE_REPO: ${{ github.repository }} | |
jobs: | |
test: | |
runs-on: ubuntu-24.04 | |
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || !github.event.pull_request.draft }} | |
steps: | |
- run: sudo apt-get update && sudo apt-get install -y gettext | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- run: pnpm run i18n:gettext-sync | |
- shell: bash | |
run: | | |
status=$(git status --porcelain) | |
if [ -n "$status" ]; then | |
echo "You have gettext translation files unsynced. Please run i18n:gettext-sync locally." | |
exit 1 | |
else | |
echo "Translations are synced." | |
fi | |
- run: pnpm i | |
- run: pnpm run postinstall | |
- run: pnpm run lint | |
- run: pnpm run typecheck | |
- run: env NODE_ENV=test pnpm run coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
build: | |
runs-on: ubuntu-24.04 | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- run: pnpm i | |
- run: pnpm run build | |
- name: Display structure of builded files | |
run: ls -R | |
working-directory: . | |
- name: Make artifact folder for dist (workaround for actions/upload-artifact@v4 bug) | |
run: mkdir ./_artifact && mv ./dist ./_artifact | |
working-directory: . | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.sha }} | |
path: ./_artifact | |
publish: | |
needs: build | |
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && (startsWith(github.ref_name, 'release') || github.ref_name == 'main')) }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.sha }} | |
- name: Display structure of downloaded files | |
run: ls -R | |
working-directory: . | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_REPO }} | |
tags: | | |
type=raw,value=${{ github.ref_name }}.{{sha}}.${{ github.run_attempt }},enable=${{github.event_name == 'push' || github.event_name == 'workflow_dispatch'}} | |
type=raw,value=${{ github.head_ref }}.{{sha}}.${{ github.run_attempt }},enable=${{github.event_name == 'pull_request'}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |