Skip to content

Commit

Permalink
Merge branch 'main' into fix-save-program
Browse files Browse the repository at this point in the history
  • Loading branch information
jpelay committed Nov 7, 2024
2 parents dd4cd47 + 6da2c52 commit 25b785d
Show file tree
Hide file tree
Showing 1,093 changed files with 143,978 additions and 470,430 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/deploy-to-alpha-manually.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Manually deploy to Alpha
on:
workflow_dispatch: {}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: akhileshns/[email protected] # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: hedy-alpha
heroku_email: [email protected]
1 change: 1 addition & 0 deletions .github/workflows/deploy-to-alpha.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Automatically deploy to Alpha
on:

# Run this AFTER the unit test job finishes
workflow_run:
# Must be the same as in unittests.yml, cypresstests.yml
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/deploy-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Restrict who can run this workflow
- if: github.actor != 'Felienne'
- if: github.actor != 'Felienne' && github.actor != 'jpelay'
run: |
echo "You must be Felienne to run this workflow :D" >&2
exit 1
Expand All @@ -17,3 +17,9 @@ jobs:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: hedy-beta
heroku_email: [email protected]
- name: "Send message on Discord"
if: success()
uses: discord-actions/message@v2
with:
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
message: "Deployed to hedy.org"
4 changes: 2 additions & 2 deletions .github/workflows/resolve-weblate-conflict.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
#----------------------------------------------------------------------
# Set up cache so that running snippet tests is somewhat cheap
- name: Calculate hedy cache key
run: "echo value=$(ls -1 hedy.py grammars/* | sort | xargs tail -n 99999999 | sha256sum | cut -f 1 -d ' ') >> $GITHUB_OUTPUT"
run: "echo value=$(ls -1 hedy.py hedy_*.py grammars/* | sort | xargs tail -n 99999999 | sha256sum | cut -f 1 -d ' ') >> $GITHUB_OUTPUT"
id: hedy_cache_key
- name: Cache hedy test runs
uses: actions/cache@v3
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Prevent updates and merge conflicts until merged
run: |
# Have to lock each component individually. Not in the UI, but using the CLI we do.
for component in glossary adventures keywords achievements quizzes commands client-messages web-texts webpages parsons tutorials slides; do
for component in glossary adventures keywords quizzes commands client-messages web-texts webpages parsons tutorials slides; do
wlc lock hedy/$component
done
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,15 @@ jobs:
# This code is also in 'update-javascript-on-main'
- name: Calculate hedy cache key
run: "echo value=$(ls -1 hedy.py grammars/* | sort | xargs tail -n 99999999 | sha256sum | cut -f 1 -d ' ') >> $GITHUB_OUTPUT"
run: "echo value=$(ls -1 hedy.py hedy_*.py grammars/* | sort | xargs tail -n 99999999 | sha256sum | cut -f 1 -d ' ') >> $GITHUB_OUTPUT"
id: hedy_cache_key
- name: Cache hedy test runs
uses: actions/cache@v3
with:
path: .test-cache
key: "hedy-test-cache-${{ steps.hedy_cache_key.outputs.value }}"

- name: Run weblate tests
- name: Run all tests with caching
shell: pwsh
id: weblate_tests
if: github.event.pull_request.user.login == 'weblate'
run: |
build-tools/github/validate --weblate
- name: Run all tests
shell: pwsh
if: github.event.pull_request.user.login != 'weblate'
run: |
build-tools/github/validate
build-tools/github/validate --all
8 changes: 5 additions & 3 deletions .github/workflows/unlock-weblate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
echo 'https://hosted.weblate.org/api/ = ${{ secrets.WEBLATE_API_KEY }}' >> .weblate
- run: |
# Have to lock each component individually. Not in the UI, but using the CLI we do.
for component in glossary adventures keywords achievements quizzes commands client-messages web-texts webpages parsons tutorials slides; do
wlc unlock hedy/$component
done
set -x
for component in glossary adventures keywords quizzes commands client-messages web-texts webpages parsons tutorials slides; do
wlc --debug unlock hedy/$component | sed 's/${{ secrets.WEBLATE_API_KEY }}/*****/g'
done
echo "All components unlocked!"
2 changes: 1 addition & 1 deletion .github/workflows/update-javascript-on-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
#----------------------------------------------------------------------
# Set up cache so that running snippet tests is somewhat cheap
- name: Calculate hedy cache key
run: "echo value=$(ls -1 hedy.py grammars/* | sort | xargs tail -n 99999999 | sha256sum | cut -f 1 -d ' ') >> $GITHUB_OUTPUT"
run: "echo value=$(ls -1 hedy.py hedy_*.py grammars/* | sort | xargs tail -n 99999999 | sha256sum | cut -f 1 -d ' ') >> $GITHUB_OUTPUT"
id: hedy_cache_key
- name: Cache hedy test runs
uses: actions/cache@v3
Expand Down
35 changes: 31 additions & 4 deletions .github/workflows/update-weblate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,43 @@ jobs:
fi
# Have to lock each component individually. Not in the UI, but using the CLI we do.
for component in glossary adventures keywords achievements quizzes commands client-messages web-texts webpages parsons tutorials slides; do
# (NOTE: this list is also below!)
for component in glossary adventures keywords quizzes commands client-messages web-texts webpages parsons tutorials slides; do
wlc lock hedy/$component
done
wlc pull
# 'commit' seems to be an async process, as sometimes nothing is pushed if we run this
# too quickly in succession. Add a short sleep to reduce chances of this happening.
# https://github.com/WeblateOrg/weblate/issues/12400
wlc commit
sleep 30
wlc push
# On our repo, 'wlc reset' consistently times out the TCP connection after waiting
# for 5 minutes. The actual reset does seem to work, so we just don't wait for the
# command to finish, otherwise all our workflow executions show errors.
sleep 60
- name: Confirm that Weblate created a new PR
run: |
prs=$(gh pr -R hedyorg/hedy list -q '.[] | select(.title | contains("Translations update"))' --json title)
if [[ "$prs" == "" ]]; then
echo "Weblate didn't create a PR! Not resetting because that would lose changes!"
# Unlock each component again so we don't stay locked
# (NOTE: this list is also above!)
for component in glossary adventures keywords quizzes commands client-messages web-texts webpages parsons tutorials slides; do
wlc unlock hedy/$component
done
exit 1
fi
env:
GH_TOKEN: ${{ github.token }}

- name: Make Weblate forget its commits
run: |
# 'wlc reset' always leads to ConnectionAborted, so don't wait for it.
# https://github.com/WeblateOrg/weblate/issues/11368
wlc reset &
sleep 10
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,12 @@ dist/
# hide file_logger.json
file_logger.json
*.tmp

# This file is generated by the flask-commonmark package.
# We submitted a PR to the package, but it's still wating to be approved
# Until then, we can include it in .gitignore
# More info in #4540
foo.txt

# Generated schema json files
*.generated.schema.json
14 changes: 9 additions & 5 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ queue_rules:
- name: default_queue
conditions:
- "check-success=build"
merge_method: squash
commit_message_template: |-
{{ title }} (#{{number}})
{{ body }}
{# Add co-author information at the end of the squash merge commit message #}
{% for co_author in co_authors | unique -%}
Co-Authored-By: {{ co_author.name }} <{{ co_author.email }}>
{% endfor -%}
{# `Co-Authored-By` lines must the be last ones for GitHub to recognize them #}
pull_request_rules:
- name: Automatic squash merge on approval
Expand All @@ -18,8 +27,3 @@ pull_request_rules:
message: Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to [allow changes to be pushed to your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)).
queue:
name: default_queue
method: squash
commit_message_template: |-
{{ title }} (#{{number}})
{{ body }}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
repos:
- repo: https://github.com/hhatto/autopep8
rev: v2.1.0
rev: v2.3.1
hooks:
- id: autopep8
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
Loading

0 comments on commit 25b785d

Please sign in to comment.