Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbreak CI after v3 merge (addresses #952) #958

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
181ca49
Unbreak CI: The 'master' branch is now called 'main'.
sshine Feb 26, 2021
20a7443
Unbreak CI: Temporarily don't stop when 'configlet lint' fails
sshine Feb 26, 2021
d615283
Unbreak CI: Move 'configlet lint' into main CI script
sshine Feb 28, 2021
57d66eb
Unbreak CI: Not necessary to checkout multiple times in same workflow
sshine Feb 28, 2021
353c96b
Unbreak CI: Forgot one 'master' -> 'main' rename
sshine Feb 28, 2021
e115605
Unbreak CI: Rename 'master' -> 'main' in bin/ensure-readmes-are-updat…
sshine Feb 28, 2021
b97ae8b
Unbreak CI: Assume 'configlet' is in path
sshine Feb 28, 2021
5fae376
Temporary change to isogram/.docs/instructions.md
sshine Feb 28, 2021
0a0f604
Unbreak CI: There is no such thing as README.md
sshine Feb 28, 2021
7fccd30
Unbreak CI: 'configlet fmt' no longer exists.
sshine Mar 1, 2021
4a6c3b1
Hm? Hm.
sshine Mar 1, 2021
52b666b
Try.
sshine Mar 1, 2021
087a2e7
Where is it?
sshine Mar 1, 2021
da89f1c
Why is main checked out, not feature branch?
sshine Mar 1, 2021
4cf0dae
Unbreak CI: Rename and chmod +x bin/ensure-stack-resolvers-synced.sh
sshine Mar 1, 2021
03ad8fd
Unbreak CI: Create JSON file with canonical stack resolver setting
sshine Mar 1, 2021
7933afe
Unbreak CI: UUIDs are now located deeper in config.json
sshine Mar 1, 2021
e056ada
Add 'practice/' subdirectory to GitHub Actions workflow
sshine Mar 11, 2021
a9570a0
Don't forget glob expansion
sshine Mar 12, 2021
292795b
Remove CI hook on this particular feature branch
sshine Mar 12, 2021
600f800
Re-enable 'with: ref: main'
sshine Mar 12, 2021
5583daa
Re-enable configlet, disable continue-on-error
sshine Mar 12, 2021
90b4bed
Add single config.json tag to pass 'configlet lint'
sshine Mar 12, 2021
7e64350
I think 'wifh: ref: main' is causing the wrong checkout
sshine Mar 12, 2021
34a9e05
Let's see if 'with: ref: main' and 'git checkout HEAD' work together
sshine Mar 12, 2021
beac847
Apparently HEAD refers to main with 'with: ref: main'
sshine Mar 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/workflows/configlet.yml

This file was deleted.

53 changes: 19 additions & 34 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
push:
branches:
- master
- main
schedule:
# Weekly.
- cron: "0 0 * * 0"
Expand All @@ -13,40 +13,31 @@ jobs:
name: Check track configuration
runs-on: ubuntu-latest
steps:
# master is needed in addition to HEAD,
# because the README check only checks exercises changed since master.
- uses: actions/checkout@v2
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
ref: master
# main is needed in addition to HEAD, because the README check only
# checks exercises changed since main. This fetches the entire repo's
# history.
fetch-depth: 0

- uses: actions/checkout@v2
- name: Fetch configlet
uses: exercism/github-actions/configlet-ci@main

- name: Fetch
run: bin/fetch-configlet
- name: Configlet Linter
run: configlet lint

- name: Lint
run: bin/configlet lint .
- name: Ensure practice exercise descriptions are synced
run: bin/ensure-practice-exercise-descriptions-are-synced.sh

- name: Ensure READMEs are updated
run: sh ./bin/ensure-readmes-are-updated.sh

- name: Check configlet fmt
run: sh ./bin/check-configlet-fmt.sh

- name: Install yq (for stack resolvers)
run: |
sudo add-apt-repository -y ppa:rmescandon/yq
sudo apt-get -q update
sudo apt-get -y install yq

- name: Ensure stack resolvers synced
run: sh ./bin/ensure-stack-resolvers-synced.sh
- name: Ensure stack resolvers are synced
run: bin/ensure-stack-resolvers-are-synced.sh

- name: Check for invalid UUIDs
# can be removed once `configlet lint` gains this ability.
# Check issue https://github.com/exercism/configlet/issues/99
# XXX: Consider adding this check for concept exercises.
run: |
uuids=$(jq --raw-output '.exercises | map(.uuid) | .[]' config.json)
uuids=$(jq --raw-output '.exercises.practice | map(.uuid) | .[]' config.json)
bad_uuid=$(echo "$uuids" | grep -vE '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' || true)
if [ -n "$bad_uuid" ]; then
echo "invalid UUIDs found! please correct these to be valid UUIDs:"
Expand Down Expand Up @@ -80,13 +71,7 @@ jobs:
# https://github.com/actions/toolkit/issues/399
continue-on-error: ${{ matrix.resolver == 'nightly' }}
steps:
- uses: actions/checkout@v2

- name: Install yq (for stack resolvers)
run: |
sudo add-apt-repository -y ppa:rmescandon/yq
sudo apt-get -q update
sudo apt-get -y install yq
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4

- name: Resolve resolver
id: resolve-resolver
Expand All @@ -98,7 +83,7 @@ jobs:
# because that would cause caches from differing LTSes to collide
# (if we have updated the LTS version of all exercises between job runs).
if [ "${{ matrix.resolver }}" = "lts-from-exercises" ]; then
resolver=$(yq read "$(ls -1 exercises/*/stack.yaml | head -1)" resolver)
resolver=$(jq --raw-output .resolver config/track-specific.json)
else
resolver=${{ matrix.resolver }}
fi
Expand Down Expand Up @@ -148,7 +133,7 @@ jobs:
export SET_RESOLVER="--resolver ${{ matrix.resolver }}"
fi

for exercise in ${{ github.workspace }}/exercises/*/; do
for exercise in ${{ github.workspace }}/exercises/practice/*; do
time bin/test-stub $exercise
time bin/test-all-examples $exercise
done
42 changes: 0 additions & 42 deletions bin/check-configlet-fmt.sh

This file was deleted.

37 changes: 37 additions & 0 deletions bin/ensure-practice-exercise-descriptions-are-synced.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh
#
# Check that practice exercise descriptions are in sync with problem-specifications.

override_message="I have confirmed that no README check is needed"

# If *any* commit message contains the override message:
if git log origin/main..HEAD | grep -q "$override_message"; then
echo "WARNING: You've overridden the README check, which applies to ALL commits in this PR."
echo "No practice exercise description in this PR will be checked for changes."
exit 0
fi

newline=$'\n '

changed_practice_exercises() {
branch_name="$(git rev-parse --abbrev-ref HEAD)"
git diff --name-only "origin/main..$branch_name" | \
grep -Po '(?<=^exercises/practice/)\w+' | sort -fu
}

missing_readmes=""
for exercise in $(changed_practice_exercises); do
echo "Checking readme for $exercise"

instructions_path="exercises/practice/$exercise/.docs/instructions.md"
if [ ! -f "$instructions_path" ]; then
missing_readmes="$missing_readmes$newline$exercise"
fi
done

if [ -n "$missing_readmes" ]; then
echo "Exercises missing instructions.md:$missing_readmes"
fi
if [ -n "$missing_readmes" ]; then
exit 1
fi
55 changes: 0 additions & 55 deletions bin/ensure-readmes-are-updated.sh

This file was deleted.

File renamed without changes.
4 changes: 3 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1182,5 +1182,7 @@
},
"concepts": [],
"key_features": [],
"tags": []
"tags": [
"paradigm/functional"
]
}
4 changes: 4 additions & 0 deletions config/track-specific.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"#comment": "This file contains track-specific settings for the Haskell track.",
"resolver": "lts-16.21"
}
2 changes: 2 additions & 0 deletions exercises/practice/isogram/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Examples of isograms:
- six-year-old

The word *isograms*, however, is not an isogram, because the s repeats.

Oh my god.