Skip to content

Commit

Permalink
feat: install TypeScript and add first model-form integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guidojw committed Dec 31, 2022
1 parent 1a7a649 commit f4826b3
Show file tree
Hide file tree
Showing 518 changed files with 5,841 additions and 4,174 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,4 @@ module.exports = {
extends: ['plugin:qunit/recommended'],
},
],
globals: {
moment: true,
},
};
22 changes: 0 additions & 22 deletions .github/problem-matchers/stylelint.json

This file was deleted.

12 changes: 5 additions & 7 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,20 @@
],
"packageRules": [
{
"matchPackageNames": ["danlynn/ember-cli", "ember-cli"],
"matchPackageNames": ["ember-cli", "danlynn/ember-cli"],
"groupName": "ember-cli",
"separateMinorPatch": true,
"draftPR": true,
"prBodyNotes": "{{#unless isPatch}}### Upgrade Instructions\n* Wait until both `danlynn/ember-cli` and `ember-cli` have the same update\n* Then follow this guide: https://cli.emberjs.com/release/basic-use/upgrading/#upgradinganemberappitself\n* Finally, make sure any package that was added to `package.json` by this process is added to `ignoreDeps` in [`renovate.json5`](https://github.com/csvalpha/amber-ui/blob/staging/.github/renovate.json5){{/unless}}"
"prBodyNotes": "### Upgrade Instructions\n\
* Wait until both `danlynn/ember-cli` and `ember-cli` have the same update{{#unless isPatch}}\n\
* Then follow this guide: https://cli.emberjs.com/release/basic-use/upgrading/#upgradinganemberappitself\n\
* Finally, make sure any package that was added to `package.json` by this process is added to `ignoreDeps` in [`renovate.json5`](https://github.com/csvalpha/amber-ui/blob/staging/.github/renovate.json5){{/unless}}"
},
{
"matchPackageNames": ["danlynn/ember-cli", "ember-cli"],
"matchUpdateTypes": ["patch"],
"draftPR": false
},
{
"description": "faker v5.5.3 -> v6.6.6 update removed all its source.",
"matchPackageNames": ["faker"],
"enabled": false
},
{
"matchManagers": ["nvm"],
"matchUpdateTypes": ["major"],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Delete old versions
uses: snok/container-retention-policy@46881d5f6ddd0509d9646f4565ddcdfdca520707 # tag=v1.4.2
uses: snok/container-retention-policy@6601a342b42bf08909bbd5b48736d4176100365b # tag=v1.5.1
with:
image-names: ${{ env.IMAGE_NAMES }}
cut-off: 2 days ago UTC
Expand Down
38 changes: 18 additions & 20 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
stage: ${{ steps.get_metadata.outputs.stage }}
steps:
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0

- name: Get metadata
id: get_metadata
Expand All @@ -48,15 +48,15 @@ jobs:
if [ "${INPUT_MERGE,,}" = 'y' ]; then
git fetch origin staging
if ! git diff origin/master origin/staging --exit-code; then
echo '::set-output name=has_diff::true'
echo 'has_diff=true' >> "$GITHUB_OUTPUT"
else
echo '::set-output name=has_diff::false'
echo 'has_diff=false' >> "$GITHUB_OUTPUT"
fi
fi
echo '::set-output name=stage::production'
echo 'stage=production' >> "$GITHUB_OUTPUT"
else
echo '::set-output name=stage::staging'
echo 'stage=staging' >> "$GITHUB_OUTPUT"
fi
merge:
Expand All @@ -82,7 +82,7 @@ jobs:
- name: Checkout code
if: fromJSON(needs.metadata.outputs.has_diff)
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0

- name: Run merge
if: fromJSON(needs.metadata.outputs.has_diff)
Expand All @@ -98,7 +98,7 @@ jobs:
if: fromJSON(needs.metadata.outputs.has_diff)
run: |
git fetch origin master
echo '::set-output name=sha::'"$(git rev-parse origin/master)"
echo 'sha='"$(git rev-parse origin/master)" >> "$GITHUB_OUTPUT"
continuous_integration:
name: Continuous Integration
Expand Down Expand Up @@ -131,30 +131,29 @@ jobs:
id: get_url
run: |
if [ "$GITHUB_REF_NAME" = 'master' ]; then
echo '::set-output name=environment_url::https://csvalpha.nl'
echo 'environment_url=https://csvalpha.nl' >> "$GITHUB_OUTPUT"
else
echo '::set-output name=environment_url::https://staging.csvalpha.nl'
echo 'environment_url=https://staging.csvalpha.nl' >> "$GITHUB_OUTPUT"
fi
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
ref: ${{ needs.merge.outputs.sha }}

- name: Start deployment
uses: bobheadxi/deployments@b0db96170b843c3c786ed42a046d869c50efe3cd # tag=v1.1.0
uses: bobheadxi/deployments@9d4477fdaa4120020cd10ab7e97f68c801422e73 # tag=v1.3.0
id: start_deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{ needs.metadata.outputs.stage }}

- name: Deploy
uses: appleboy/ssh-action@1d1b21ca96111b1eb4c03c21c14ebb971d2200f6 # tag=v0.1.4
uses: appleboy/ssh-action@4a03da89e5c43da56e502053be4bbcb293411883 # v0.1.6
env:
STAGE: ${{ needs.metadata.outputs.stage }}
with:
host: csvalpha.nl
host: ssh.csvalpha.nl
username: github-actions
key: ${{ secrets.SSH_PRIVATE_KEY }}
envs: PROJECT_NAME,STAGE
Expand All @@ -164,7 +163,7 @@ jobs:
docker-compose up -d
- name: Finalize Sentry release
uses: getsentry/action-release@744e4b262278339b79fb39c8922efcae71e98e39 # tag=v1.1.6
uses: getsentry/action-release@bd5f874fcda966ba48139b0140fb3ec0cb3aabdd # v1.2.1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_PROJECT: ${{ env.PROJECT_NAME }}
Expand All @@ -174,11 +173,10 @@ jobs:
set_commits: skip

- name: Finish deployment
uses: bobheadxi/deployments@b0db96170b843c3c786ed42a046d869c50efe3cd # tag=v1.1.0
uses: bobheadxi/deployments@9d4477fdaa4120020cd10ab7e97f68c801422e73 # tag=v1.3.0
if: steps.start_deployment.conclusion == 'success' && always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.start_deployment.outputs.deployment_id }}
env: ${{ needs.metadata.outputs.stage }}
Expand All @@ -203,16 +201,16 @@ jobs:
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
echo '::set-output name=conclusion::success'
echo 'conclusion=success' >> "$GITHUB_OUTPUT"
for RESULT in $RESULTS; do
if [ "$RESULT" = 'cancelled' ] || [ "$RESULT" = 'failure' ]; then
echo '::set-output name=conclusion::'"$RESULT"
echo 'conclusion='"$RESULT" >> "$GITHUB_OUTPUT"
break
fi
done
- name: Update Continuous Delivery check run
uses: guidojw/actions/update-check-run@2b1dea8cbd9e44491c269e771b75636026caf8ca # tag=v1.1.0
uses: guidojw/actions/update-check-run@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
with:
app_id: ${{ env.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
Expand Down
26 changes: 10 additions & 16 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
ref: ${{ inputs.sha }}

- name: Build test image
uses: guidojw/actions/build-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # tag=v1.1.0
uses: guidojw/actions/build-docker-image@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
with:
file: Dockerfile
target: base
Expand All @@ -34,7 +34,7 @@ jobs:
needs: build
steps:
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
ref: ${{ inputs.sha }}

Expand All @@ -43,31 +43,25 @@ jobs:
echo '::add-matcher::.github/problem-matchers/actionlint.json'
echo '::add-matcher::.github/problem-matchers/ember-template-lint.json'
echo '::add-matcher::.github/problem-matchers/eslint-stylish.json'
echo '::add-matcher::.github/problem-matchers/stylelint.json'
- name: Download actionlint
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
- name: Set up Node.js
uses: actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3.1.1
with:
node-version-file: .nvmrc
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.22
- name: Load test image
uses: guidojw/actions/load-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # tag=v1.1.0
uses: guidojw/actions/load-docker-image@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
with:
name: app

- name: Lint
# Convert output of stylelint so that the problem matcher can match it correctly.
run: |
EXIT_STATUS=0
./actionlint -ignore 'property "app_private_key" is not defined' -ignore 'SC2153:' || EXIT_STATUS=$?
./actionlint -ignore 'property "app_private_key" is not defined' -ignore 'SC2153:' \
-ignore 'property "sha" is not defined in object type {}' || EXIT_STATUS=$?
docker run app yarn lint:hbs || EXIT_STATUS=$?
docker run app yarn lint:js || EXIT_STATUS=$?
STYLELINT_OUTPUT="$(docker run app yarn lint:scss)" || EXIT_STATUS=$?
node bin/convert-stylelint-output.js "$STYLELINT_OUTPUT"
docker run app /bin/bash -c 'yarn lint:scss -f github | sed "s|$(pwd)/||g" ; exit ${PIPESTATUS[0]}' || \
EXIT_STATUS=$?
exit $EXIT_STATUS
test:
Expand All @@ -76,7 +70,7 @@ jobs:
needs: build
steps:
- name: Load test image
uses: guidojw/actions/load-docker-image@2b1dea8cbd9e44491c269e771b75636026caf8ca # tag=v1.1.0
uses: guidojw/actions/load-docker-image@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
with:
name: app

Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@ jobs:
INPUT_SHA: ${{ inputs.sha }}
run: |
if [ "$GITHUB_REF_NAME" = 'master' ]; then
echo '::set-output name=tag::latest'
echo 'tag=latest' >> "$GITHUB_OUTPUT"
else
echo '::set-output name=tag::'"$GITHUB_REF_NAME"
echo 'tag='"$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
fi
if [ "$GITHUB_REF_NAME" = 'staging' ] || [ "$GITHUB_REF_NAME" = 'master' ]; then
BUILD_ARGS='BUILD_HASH='${INPUT_SHA:-$GITHUB_SHA}
if [ "$GITHUB_REF_NAME" = 'staging' ]; then
BUILD_ARGS+=$'\nDEPLOY_TARGET=staging'
fi
BUILD_ARGS=${BUILD_ARGS//$'\n'/'%0A'}
echo '::set-output name=build_args::'"$BUILD_ARGS"
{
echo 'build_args<<EOF'
echo "$BUILD_ARGS"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
fi
publish:
Expand All @@ -55,24 +58,24 @@ jobs:
needs: metadata
steps:
- name: Checkout code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
with:
ref: ${{ inputs.sha }}
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f211e3e9ded2d9377c8cadc4489a4e38014bc4c9 # tag=v1.7.0
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # tag=v2.2.1

- name: Login to GitHub Container Registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # tag=v2.0.0
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # tag=v2.1.0
with:
registry: ${{ env.REGISTRY_URL }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push image
id: build_push_image
uses: docker/build-push-action@e551b19e49efd4e98792db7592c17c09b89db8d8 # tag=v3.0.0
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # tag=v3.2.0
with:
push: true
context: .
Expand All @@ -92,7 +95,7 @@ jobs:
- name: Create Sentry release
if: ${{ !(github.event_name == 'workflow_dispatch' && github.workflow == 'Publish Image') }}
uses: getsentry/action-release@744e4b262278339b79fb39c8922efcae71e98e39 # tag=v1.1.6
uses: getsentry/action-release@bd5f874fcda966ba48139b0140fb3ec0cb3aabdd # v1.2.1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_PROJECT: ${{ env.PROJECT_NAME }}
Expand All @@ -113,16 +116,16 @@ jobs:
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
echo '::set-output name=conclusion::success'
echo 'conclusion=success' >> "$GITHUB_OUTPUT"
for RESULT in $RESULTS; do
if [ "$RESULT" = 'cancelled' ] || [ "$RESULT" = 'failure' ]; then
echo '::set-output name=conclusion::'"$RESULT"
echo 'conclusion='"$RESULT" >> "$GITHUB_OUTPUT"
break
fi
done
- name: Update Publish Image check run
uses: guidojw/actions/update-check-run@2b1dea8cbd9e44491c269e771b75636026caf8ca # tag=v1.1.0
uses: guidojw/actions/update-check-run@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
with:
app_id: ${{ env.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.19.2
14.21.2
6 changes: 4 additions & 2 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ module.exports = {
'./.stylelintrc.order.js',
],
rules: {
'annotation-no-unknown': [true, { ignoreAnnotations: ['default'] }],
'at-rule-no-unknown': null, // use scss/at-rule-no-unknown instead
'no-descending-specificity': null,
'import-notation': 'string',
'max-nesting-depth': 3,
'scss/at-rule-no-unknown': true,
'no-descending-specificity': null,
'scss/at-rule-no-unknown': null,
'scss/dollar-variable-colon-space-after': null,
'selector-class-pattern': null,
},
Expand Down
3 changes: 0 additions & 3 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ module.exports = {
rules: {
'no-bare-strings': false,
'block-indentation': 2,
'no-html-comments': true,
'no-triple-curlies': true,
'no-shadowed-elements': true,
// TODO: activate those
'no-implicit-this': false,
'require-valid-alt-text': false,
Expand Down
Loading

0 comments on commit f4826b3

Please sign in to comment.