This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Split CI into discrete jobs * Update outdated POT file * Skip writing POT file if the only thing changing is the date * Format yaml * Add yaml to lint staged * Get locales when setting up node env * Cram it all into a single workflow * Add getting translations
- Loading branch information
1 parent
caac64a
commit 5b24e6f
Showing
7 changed files
with
137 additions
and
121 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: openverse-frontend/setup-node-env | ||
description: Setup the Node.js environment including `pnpm` and dependencies | ||
|
||
inputs: | ||
install: | ||
default: true | ||
description: Whether to install dependencies. | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: pnpm/action-setup@v2.0.1 | ||
with: | ||
version: 6.30.1 | ||
|
||
- name: Cache pnpm modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v2.5.1 | ||
with: | ||
node-version: 16 | ||
cache: pnpm | ||
cache-dependency-path: | | ||
pnpm-lock.yaml | ||
.npmrc | ||
- name: Install | ||
if: inputs.install | ||
shell: bash | ||
run: "pnpm install" | ||
|
||
- name: Get locales | ||
shell: bash | ||
run: "pnpm i18n:create-locales-list && pnpm i18n:update-locales && pnpm i18n:get-translations" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,103 @@ | ||
name: openverse-frontend-ci | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
branches: -main | ||
pull_request: | ||
branches: | ||
- main | ||
- audio | ||
|
||
jobs: | ||
ci: | ||
name: Run CI tests | ||
types: | ||
name: Check types | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "16.13.0" | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}- | ||
- uses: pnpm/action-setup@v2.0.1 | ||
with: | ||
version: 6.24.0 | ||
run_install: | | ||
- recursive: true | ||
args: [--frozen-lockfile] | ||
- name: Run lint | ||
- uses: ./.github/actions/setup-node-env | ||
|
||
- name: Check types | ||
run: pnpm types | ||
|
||
lint: | ||
name: Lint files | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ./.github/actions/setup-node-env | ||
|
||
- name: ESLint | ||
run: pnpm lint | ||
|
||
- name: Run formatting test | ||
- name: Prettier | ||
run: pnpm format:test | ||
|
||
- name: Run tests | ||
run: pnpm i18n:get-translations && pnpm test:unit | ||
i18n: | ||
name: Check translation files | ||
runs-on: ubuntu-latest | ||
|
||
- name: Run Storybook smoke-test | ||
run: pnpm storybook -- --ci --smoke-test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ./.github/actions/setup-node-env | ||
|
||
- name: Check extracted strings | ||
run: pnpm vue-i18n-check | ||
|
||
- name: Check POT files are updated | ||
shell: bash | ||
run: | | ||
pnpm i18n:generate-pot | ||
exit $(git status -s -uno | wc -l) | ||
unit: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ./.github/actions/setup-node-env | ||
|
||
- name: Run unit tests | ||
run: pnpm test | ||
|
||
e2e: | ||
name: E2E tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ./.github/actions/setup-node-env | ||
|
||
- name: Install E2E browsers | ||
run: pnpx playwright install | ||
|
||
- name: Run E2E | ||
- name: Run E2E tests | ||
run: pnpm e2e:ci | ||
|
||
storybook: | ||
name: Check Storybook build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ./.github/actions/setup-node-env | ||
|
||
- name: Run Storybook smoke-test | ||
run: pnpm storybook -- --ci --smoke-test | ||
|
||
build: | ||
name: Check Nuxt build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: ./.github/actions/setup-node-env | ||
|
||
- name: Run build | ||
run: pnpm build |
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
This file was deleted.
Oops, something went wrong.
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
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
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