-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a github action to run the tests (#745)
* fix: remove unneeded files * feat: add github action * fix: remove warning in react useEffect * fix: use number primitive type in TS * feat: ajout du script pour checker les types ts * fix: correction TS Utilisation du type primitif number à la place du wrapper Number pour les types Utilisation de la syntaxe ? pour les champs optionnels. * fix: correction des tests et désactivation locale de TS Désactivation temporaire, en attendant de savoir si on doit modifier les types (en rendant certains champs optionnels) ou si on doit modifier les tests (en ajoutant des champs qui manquent). * feat: add type-check in CI * fix: hidden files and dir was not removed in deploy branch
- Loading branch information
Showing
36 changed files
with
159 additions
and
2,401 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,96 @@ | ||
on: | ||
push: | ||
branches: ["*"] | ||
pull_request: | ||
branches: ["*"] | ||
|
||
name: Install, build & test | ||
jobs: | ||
# As its name stands for, this jobs will install the npm dependencies and cache them | ||
# unless they have been cached in a previous workflow run and remained unchanged. | ||
install-cache: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache yarn dependencies | ||
uses: actions/cache@v2 | ||
id: cache-dependencies | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
# Check for `cache-hit` (`steps.cache-dependencies.cache-hit != 'true'`) | ||
# If there's a cache hit, we skip this step (the dependencies are already available) | ||
# If there's no cache hit, we run "yarn install" | ||
if: steps.cache-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
yarn install --frozen-lockfile --force --non-interactive | ||
type-check: | ||
runs-on: ubuntu-latest | ||
needs: install-cache | ||
|
||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v2 | ||
|
||
# Here we use actions/cache again but this time only to restore the dependencies | ||
# At this stage of the workflow we're sure that the dependencies have been installed and cached | ||
# either on this same run, or on a previous CI run. Thus we can skip trying to run "yarn install". | ||
- name: Restore yarn dependencies | ||
uses: actions/cache@v2 | ||
id: cache-dependencies | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Check types | ||
run: | | ||
yarn type-check | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
needs: install-cache | ||
|
||
steps: | ||
- name: Checkout Commit | ||
uses: actions/checkout@v2 | ||
|
||
- name: Restore yarn dependencies | ||
uses: actions/cache@v2 | ||
id: cache-dependencies | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Run test | ||
run: yarn test | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: [type-check, unit-test] | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Restore yarn dependencies | ||
uses: actions/cache@v2 | ||
id: cache-dependencies | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Build app | ||
run: yarn build |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.