Update to latest version (#7)

This commit is contained in:
Erik Schierboom
2021-10-18 14:10:32 +02:00
committed by GitHub
parent de0dbb67e9
commit baa09f6462
14 changed files with 283 additions and 133 deletions

32
.appends/.github/labels.yml vendored Normal file
View File

@@ -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"

69
.gitattributes vendored Normal file
View File

@@ -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

View File

@@ -1,64 +0,0 @@
# This workflow will do a clean install of the dependencies and run tests across different versions
#
# Replace <track> with the track name
# Replace <image-name> with an image to run the jobs on
# Replace <action to setup tooling> with a github action to setup tooling on the image
# Replace <install dependencies> with a cli command to install the dependencies
# Replace <code-extensions> 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: <track> / main
on:
push:
branches: [main]
workflow_dispatch:
jobs:
precheck:
runs-on: <image-name>
steps:
- uses: actions/checkout@v2
- name: Use <setup tooling>
uses: <action to setup tooling>
with:
# Here, use the LTS/stable version of the track's tooling, e.g.:
# node-version: 12.x
- name: Install project dependencies
run: <install dependencies>
- name: Run exercism/<track> ci pre-check (checks config, lint code) for all exercises
run: scripts/ci-check
ci:
runs-on: <image-name>
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 <setup tooling> ${{ matrix.version }}
uses: <action to setup tooling>
with:
# Use the ${{ matrix.x }} format to inject variables into commands
# node-version: ${{ matrix.version }}
- name: Install project dependencies
run: <install dependencies>
- name: Run exercism/<track> ci (runs tests) for all exercises
run: scripts/ci

View File

@@ -1,68 +0,0 @@
# This workflow will do a clean install of the dependencies and run tests across different versions
#
# Replace <track> with the track name
# Replace <image-name> with an image to run the jobs on
# Replace <action to setup tooling> with a github action to setup tooling on the image
# Replace <install dependencies> with a cli command to install the dependencies
# Replace <code-extensions> 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: <track> / pr
on: pull_request
jobs:
precheck:
runs-on: <image-name>
steps:
- name: Checkout PR
uses: actions/checkout@v2
- name: Use Node.js LTS (12.x)
uses: <action to setup tooling>
with:
# Here, use the LTS/stable version of the track's tooling, e.g.:
# node-version: 12.x
- name: Install project dependencies
run: <install dependencies>
# Replace <code-extensions> with file extensions that should trigger this check. Replace with .* to allow anything.
- name: Run exercism/<track> 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("\\.(<code-extensions>|md|json)$")) | .filename' | \
xargs -r scripts/pr-check
ci:
runs-on: <image-name>
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 <setup tooling> ${{ matrix.version }}
uses: <action to setup tooling>
with:
# Use the ${{ matrix.x }} format to inject variables into commands
# node-version: ${{ matrix.version }}
- name: Install project dependencies
run: <install dependencies>
# Replace <code-extensions> with file extensions that should trigger running tests. Replace with .* to allow anything.
- name: Run exercism/<track> 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("\\.(<code-extensions>|md|json)$")) | .filename' | \
xargs -r scripts/pr

39
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
# This workflow will do a clean install of the dependencies and run tests across different versions
#
# Replace <track> with the track name
# Replace <image-name> with an image to run the jobs on
# Replace <action to setup tooling> with a github action to setup tooling on the image
# Replace <install dependencies> 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: <track> / Test
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
ci:
runs-on: <image-name>
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use <setup tooling>
uses: <action to setup tooling>
- name: Install project dependencies
run: <install dependencies>
- name: Run tests for all exercises
run: bin/test

View File

@@ -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
```

35
bin/test Executable file
View File

@@ -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

View File

@@ -0,0 +1,14 @@
# About
<!-- TODO: write document
This document contains a short introduction to the language.
The introduction should be relatively brief and touch upon what
makes the language interesting (and possibly unique). The goal
is to help students decide if they want to join this track.
The contents of this document are displayed on the track page,
provided the student has not joined the track.
See https://exercism.org/docs/building/tracks/docs for more information. -->

View File

@@ -0,0 +1,15 @@
# Installation
<!-- TODO: write document
This document should describe what the student needs to install
to allow working on the track on their local system using the CLI.
You can include the installation instructions in this document, but
usually it is better to link to a resource with the official installation
instructions, to prevent the instructions from becoming outdated.
The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/installation`.
See https://exercism.org/docs/building/tracks/docs for more information. -->

View File

@@ -0,0 +1,13 @@
# Learning
<!-- TODO: write document
This document should link to learning resources.
Feel free to link to any good learning resources you know, whether they
be websites, blogs, books, videos or courses.
The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/learning`.
See https://exercism.org/docs/building/tracks/docs for more information. -->

View File

@@ -0,0 +1,13 @@
# Resources
<!-- TODO: write document
This document should link to useful resources.
Feel free to link to any good resources you know, whether they
be websites, videos, mailing lists, etc.
The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/resources`.
See https://exercism.org/docs/building/tracks/docs for more information. -->

View File

@@ -0,0 +1 @@
TODO: add snippet

View File

@@ -0,0 +1,15 @@
# Tests
<!-- TODO: write document
This document should describe everything related to running tests in the track.
If your track uses skipped tests, this document can explain why thet is used and
how to unskip tests.
This document can also link to the testing framework documentation.
The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/tests`.
See https://exercism.org/docs/building/tracks/docs for more information. -->