From baa09f64621f47b1d0961868a6015c4624fbd1c6 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Mon, 18 Oct 2021 14:10:32 +0200 Subject: [PATCH] Update to latest version (#7) --- .appends/.github/labels.yml | 32 +++++++++++++++++ .gitattributes | 69 +++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 64 ---------------------------------- .github/workflows/pr.ci.yml | 68 ------------------------------------ .github/workflows/test.yml | 39 +++++++++++++++++++++ README.md | 38 +++++++++++++++++++- bin/test | 35 +++++++++++++++++++ {img => concepts}/.keep | 0 docs/ABOUT.md | 14 ++++++++ docs/INSTALLATION.md | 15 ++++++++ docs/LEARNING.md | 13 +++++++ docs/RESOURCES.md | 13 +++++++ docs/SNIPPET.txt | 1 + docs/TESTS.md | 15 ++++++++ 14 files changed, 283 insertions(+), 133 deletions(-) create mode 100644 .appends/.github/labels.yml create mode 100644 .gitattributes delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/pr.ci.yml create mode 100644 .github/workflows/test.yml create mode 100755 bin/test rename {img => concepts}/.keep (100%) diff --git a/.appends/.github/labels.yml b/.appends/.github/labels.yml new file mode 100644 index 0000000..bb722a1 --- /dev/null +++ b/.appends/.github/labels.yml @@ -0,0 +1,32 @@ +# ----------------------------------------------------------------------------------------- # +# These are the repository-specific labels that augment the Exercise-wide labels defined in # +# https://github.com/exercism/org-wide-files/blob/main/global-files/.github/labels.yml. # +# ----------------------------------------------------------------------------------------- # + +- name: "duplicate" + description: "" + color: "cccccc" + +- name: "enhancement" + description: "" + color: "84b6eb" + +- name: "invalid" + description: "" + color: "e6e6e6" + +- name: "needs maintainer" + description: "" + color: "fc2929" + +- name: "new track" + description: "" + color: "159818" + +- name: "question" + description: "" + color: "cc317c" + +- name: "wontfix" + description: "" + color: "ffffff" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dc43d72 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,69 @@ +# Handle line endings automatically for files detected as text +# and leave all files detected as binary untouched. +* text=auto + +# Force the following filetypes to have unix eols, so Windows does not break them +*.* text eol=lf + +# Windows forced line-endings +/.idea/* text eol=crlf + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +# +## These files are binary and should be left untouched +# + +# (binary is a macro for -text -diff) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.mov binary +*.mp4 binary +*.mp3 binary +*.flv binary +*.fla binary +*.swf binary +*.gz binary +*.zip binary +*.7z binary +*.ttf binary +*.eot binary +*.woff binary +*.pyc binary +*.pdf binary +*.ez binary +*.bz2 binary +*.swp binary + +*.tgz filter=lfs diff=lfs merge=lfs -text +*.psd filter=lfs diff=lfs merge=lfs -text + +# Force bash scripts to always use lf line endings so that if a repo is accessed +# in Unix via a file share from Windows, the scripts will work. +*.sh text eol=lf + +# Force batch scripts to always use CRLF line endings so that if a repo is accessed +# in Windows via a file share from Linux, the scripts will work. +*.{cmd,[cC][mM][dD]} text eol=crlf +*.{bat,[bB][aA][tT]} text eol=crlf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 7d297ed..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,64 +0,0 @@ -# This workflow will do a clean install of the dependencies and run tests across different versions -# -# Replace with the track name -# Replace with an image to run the jobs on -# Replace with a github action to setup tooling on the image -# Replace with a cli command to install the dependencies -# Replace with file extensions that should trigger the workflow -# -# Find Github Actions to setup tooling here: -# - https://github.com/actions/?q=setup&type=&language= -# - https://github.com/actions/starter-workflows/tree/main/ci -# - https://github.com/marketplace?type=actions&query=setup -# -# Requires scripts: -# - scripts/ci-check -# - scripts/ci - -name: / main - -on: - push: - branches: [main] - workflow_dispatch: - -jobs: - precheck: - runs-on: - - steps: - - uses: actions/checkout@v2 - - name: Use - uses: - with: - # Here, use the LTS/stable version of the track's tooling, e.g.: - # node-version: 12.x - - - name: Install project dependencies - run: - - - name: Run exercism/ ci pre-check (checks config, lint code) for all exercises - run: scripts/ci-check - - ci: - runs-on: - - strategy: - matrix: - # Here, add all SUPPORTED versions only, e.g.: - # version: [10.x, 12.x, 14.x] - # Optionally, add more matrix variables, such as os or arch - - steps: - - uses: actions/checkout@v2 - - name: Use ${{ matrix.version }} - uses: - with: - # Use the ${{ matrix.x }} format to inject variables into commands - # node-version: ${{ matrix.version }} - - - name: Install project dependencies - run: - - - name: Run exercism/ ci (runs tests) for all exercises - run: scripts/ci diff --git a/.github/workflows/pr.ci.yml b/.github/workflows/pr.ci.yml deleted file mode 100644 index 5c166c3..0000000 --- a/.github/workflows/pr.ci.yml +++ /dev/null @@ -1,68 +0,0 @@ -# This workflow will do a clean install of the dependencies and run tests across different versions -# -# Replace with the track name -# Replace with an image to run the jobs on -# Replace with a github action to setup tooling on the image -# Replace with a cli command to install the dependencies -# Replace with file extensions that should trigger the workflow -# -# Requires scripts: -# - scripts/pr-check path/to/changed/file path/to/changed/file -# - scripts/pr path/to/changed/file path/to/changed/file - -name: / pr - -on: pull_request - -jobs: - precheck: - runs-on: - - steps: - - name: Checkout PR - uses: actions/checkout@v2 - - - name: Use Node.js LTS (12.x) - uses: - with: - # Here, use the LTS/stable version of the track's tooling, e.g.: - # node-version: 12.x - - - name: Install project dependencies - run: - - # Replace with file extensions that should trigger this check. Replace with .* to allow anything. - - name: Run exercism/ ci pre-check (stub files, config integrity) for changed exercises - run: | - PULL_REQUEST_URL=$(jq -r ".pull_request.url" "$GITHUB_EVENT_PATH") - curl --url $"${PULL_REQUEST_URL}/files" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | \ - jq -c '.[] | select(.status == "added" or .status == "modified") | select(.filename | match("\\.(|md|json)$")) | .filename' | \ - xargs -r scripts/pr-check - - ci: - runs-on: - - strategy: - matrix: - # Here, add all SUPPORTED versions only, e.g.: - # version: [10.x, 12.x, 14.x] - # Optionally, add more matrix variables, such as os or arch - - steps: - - uses: actions/checkout@v2 - - name: Use ${{ matrix.version }} - uses: - with: - # Use the ${{ matrix.x }} format to inject variables into commands - # node-version: ${{ matrix.version }} - - - name: Install project dependencies - run: - - # Replace with file extensions that should trigger running tests. Replace with .* to allow anything. - - name: Run exercism/ ci (runs tests) for changed/added exercises - run: | - PULL_REQUEST_URL=$(jq -r ".pull_request.url" "$GITHUB_EVENT_PATH") - curl --url $"${PULL_REQUEST_URL}/files" --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | \ - jq -c '.[] | select(.status == "added" or .status == "modified") | select(.filename | match("\\.(|md|json)$")) | .filename' | \ - xargs -r scripts/pr diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..303726d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +# This workflow will do a clean install of the dependencies and run tests across different versions +# +# Replace with the track name +# Replace with an image to run the jobs on +# Replace with a github action to setup tooling on the image +# Replace with a cli command to install the dependencies +# +# Find Github Actions to setup tooling here: +# - https://github.com/actions/?q=setup&type=&language= +# - https://github.com/actions/starter-workflows/tree/main/ci +# - https://github.com/marketplace?type=actions&query=setup +# +# Requires scripts: +# - bin/test + +name: / Test + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + ci: + runs-on: + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Use + uses: + + - name: Install project dependencies + run: + + - name: Run tests for all exercises + run: bin/test diff --git a/README.md b/README.md index fbfa53d..f9461ec 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,41 @@ # Exercism ABAP Track -[![configlet](https://github.com/exercism/abap/workflows/configlet/badge.svg)](https://github.com/exercism/abap/actions?query=workflow%3Aconfiglet) +[![configlet](https://github.com/exercism/abap/workflows/configlet/badge.svg)](https://github.com/exercism/abap/actions?query=workflow%3Aconfiglet) [![test](https://github.com/exercism/abap/workflows/test/badge.svg)](https://github.com/exercism/abap/actions?query=workflow%3Atest) Exercism exercises in ABAP. + +## Testing + +To test the exercises, run `./bin/test`. +This command will iterate over all exercises and check to see if their exemplar/example implementation passes all the tests. + +### Track linting + +[`configlet`](https://exercism.org/docs/building/configlet) is an Exercism-wide tool for working with tracks. You can download it by running: + +```shell +$ ./bin/fetch-configlet +``` + +Run its [`lint` command](https://exercism.org/docs/building/configlet/lint) to verify if all exercises have all the necessary files and if config files are correct: + +```shell +$ ./bin/configlet lint + +The lint command is under development. +Please re-run this command regularly to see if your track passes the latest linting rules. + +Basic linting finished successfully: +- config.json exists and is valid JSON +- config.json has these valid fields: + language, slug, active, blurb, version, status, online_editor, key_features, tags +- Every concept has the required .md files +- Every concept has a valid links.json file +- Every concept has a valid .meta/config.json file +- Every concept exercise has the required .md files +- Every concept exercise has a valid .meta/config.json file +- Every practice exercise has the required .md files +- Every practice exercise has a valid .meta/config.json file +- Required track docs are present +- Required shared exercise docs are present +``` diff --git a/bin/test b/bin/test new file mode 100755 index 0000000..8d31328 --- /dev/null +++ b/bin/test @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# Synopsis: +# Test the track's exercises. +# +# At a minimum, this file must check if the example/exemplar solution of each +# Practice/Concept Exercise passes the exercise's tests. +# +# To check this, you usually have to (temporarily) replace the exercise's solution files +# with its exemplar/example files. +# +# If your track uses skipped tests, make sure to (temporarily) enable these tests +# before running the tests. +# +# The path to the solution/example/exemplar files can be found in the exercise's +# .meta/config.json file, or possibly inferred from the exercise's directory name. + +# Example: +# ./bin/test + +# Verify the Concept Exercises +for concept_exercise_dir in ./exercises/concept/*/; do + if [ -d $concept_exercise_dir ]; then + echo "Checking $(basename "${concept_exercise_dir}") exercise..." + # TODO: run command to verify that the exemplar solution passes the tests + fi +done + +# Verify the Practice Exercises +for practice_exercise_dir in ./exercises/practice/*/; do + if [ -d $practice_exercise_dir ]; then + echo "Checking $(basename "${practice_exercise_dir}") exercise..." + # TODO: run command to verify that the example solution passes the tests + fi +done diff --git a/img/.keep b/concepts/.keep similarity index 100% rename from img/.keep rename to concepts/.keep diff --git a/docs/ABOUT.md b/docs/ABOUT.md index e69de29..9864ed0 100644 --- a/docs/ABOUT.md +++ b/docs/ABOUT.md @@ -0,0 +1,14 @@ +# About + + diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index e69de29..cd6ce85 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -0,0 +1,15 @@ +# Installation + + diff --git a/docs/LEARNING.md b/docs/LEARNING.md index e69de29..b14434d 100644 --- a/docs/LEARNING.md +++ b/docs/LEARNING.md @@ -0,0 +1,13 @@ +# Learning + + diff --git a/docs/RESOURCES.md b/docs/RESOURCES.md index e69de29..9811f04 100644 --- a/docs/RESOURCES.md +++ b/docs/RESOURCES.md @@ -0,0 +1,13 @@ +# Resources + + diff --git a/docs/SNIPPET.txt b/docs/SNIPPET.txt index e69de29..4b4a4f0 100644 --- a/docs/SNIPPET.txt +++ b/docs/SNIPPET.txt @@ -0,0 +1 @@ +TODO: add snippet diff --git a/docs/TESTS.md b/docs/TESTS.md index e69de29..bec9502 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -0,0 +1,15 @@ +# Tests + +