Bootstrap ABAP track
This commit is contained in:
2
.github/CODEOWNERS
vendored
Normal file
2
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Maintainers
|
||||
config/maintainers.json @exercism/maintainers-admin
|
||||
64
.github/workflows/ci.yml
vendored
Normal file
64
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# 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
|
||||
18
.github/workflows/configlet.yml
vendored
Normal file
18
.github/workflows/configlet.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# This workflow will do a fetch the latest configlet binary and lint this repository.
|
||||
|
||||
name: configlet
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Fetch configlet
|
||||
uses: exercism/github-actions/configlet-ci@main
|
||||
|
||||
- name: Configlet Linter
|
||||
run: configlet lint
|
||||
68
.github/workflows/pr.ci.yml
vendored
Normal file
68
.github/workflows/pr.ci.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# 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
|
||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
*.swp
|
||||
.DS_Store
|
||||
bin/configlet
|
||||
bin/configlet.exe
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Exercism
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
5
README.md
Normal file
5
README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Exercism ABAP Track
|
||||
|
||||
[](https://github.com/exercism/abap/actions?query=workflow%3Aconfiglet)
|
||||
|
||||
Exercism exercises in ABAP.
|
||||
52
bin/fetch-configlet
Executable file
52
bin/fetch-configlet
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
readonly LATEST='https://api.github.com/repos/exercism/configlet/releases/latest'
|
||||
|
||||
case "$(uname)" in
|
||||
(Darwin*) OS='mac' ;;
|
||||
(Linux*) OS='linux' ;;
|
||||
(Windows*) OS='windows' ;;
|
||||
(MINGW*) OS='windows' ;;
|
||||
(MSYS_NT-*) OS='windows' ;;
|
||||
(*) OS='linux' ;;
|
||||
esac
|
||||
|
||||
case "$OS" in
|
||||
(windows*) EXT='zip' ;;
|
||||
(*) EXT='tgz' ;;
|
||||
esac
|
||||
|
||||
case "$(uname -m)" in
|
||||
(*64*) ARCH='64bit' ;;
|
||||
(*686*) ARCH='32bit' ;;
|
||||
(*386*) ARCH='32bit' ;;
|
||||
(*) ARCH='64bit' ;;
|
||||
esac
|
||||
|
||||
if [ -z "${GITHUB_TOKEN}" ]
|
||||
then
|
||||
HEADER=''
|
||||
else
|
||||
HEADER="authorization: Bearer ${GITHUB_TOKEN}"
|
||||
fi
|
||||
|
||||
FILENAME="configlet-${OS}-${ARCH}.${EXT}"
|
||||
|
||||
get_url () {
|
||||
curl --header "$HEADER" -s "$LATEST" |
|
||||
awk -v filename=$FILENAME '$1 ~ /browser_download_url/ && $2 ~ filename { print $2 }' |
|
||||
tr -d '"'
|
||||
}
|
||||
|
||||
URL=$(get_url)
|
||||
|
||||
case "$EXT" in
|
||||
(*zip)
|
||||
curl --header "$HEADER" -s --location "$URL" -o bin/latest-configlet.zip
|
||||
unzip bin/latest-configlet.zip -d bin/
|
||||
rm bin/latest-configlet.zip
|
||||
;;
|
||||
(*) curl --header "$HEADER" -s --location "$URL" | tar xz -C bin/ ;;
|
||||
esac
|
||||
24
bin/fetch-configlet.ps1
Normal file
24
bin/fetch-configlet.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
Function DownloadUrl ([string] $FileName, $Headers) {
|
||||
$latestUrl = "https://api.github.com/repos/exercism/configlet/releases/latest"
|
||||
$json = Invoke-RestMethod -Headers $Headers -Uri $latestUrl
|
||||
$json.assets | Where-Object { $_.browser_download_url -match $FileName } | Select-Object -ExpandProperty browser_download_url
|
||||
}
|
||||
|
||||
Function Headers {
|
||||
If ($GITHUB_TOKEN) { @{ Authorization = "Bearer ${GITHUB_TOKEN}" } } Else { @{ } }
|
||||
}
|
||||
|
||||
Function Arch {
|
||||
If ([Environment]::Is64BitOperatingSystem) { "64bit" } Else { "32bit" }
|
||||
}
|
||||
|
||||
$arch = Arch
|
||||
$headers = Headers
|
||||
$fileName = "configlet-windows-$arch.zip"
|
||||
$outputDirectory = "bin"
|
||||
$outputFile = Join-Path -Path $outputDirectory -ChildPath $fileName
|
||||
$zipUrl = DownloadUrl -FileName $fileName -Headers $headers
|
||||
|
||||
Invoke-WebRequest -Headers $headers -Uri $zipUrl -OutFile $outputFile
|
||||
Expand-Archive $outputFile -DestinationPath $outputDirectory -Force
|
||||
Remove-Item -Path $outputFile
|
||||
24
config.json
Normal file
24
config.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"language": "ABAP",
|
||||
"slug": "abap",
|
||||
"active": false,
|
||||
"status": {
|
||||
"concept_exercises": false,
|
||||
"test_runner": false,
|
||||
"representer": false,
|
||||
"analyzer": false
|
||||
},
|
||||
"blurb": "",
|
||||
"version": 3,
|
||||
"online_editor": {
|
||||
"indent_style": "space",
|
||||
"indent_size": 4
|
||||
},
|
||||
"exercises": {
|
||||
"concept": [],
|
||||
"practice": []
|
||||
},
|
||||
"concepts": [],
|
||||
"key_features": [],
|
||||
"tags": []
|
||||
}
|
||||
4
config/maintainers.json
Normal file
4
config/maintainers.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"docs_url": "https://github.com/exercism/docs/blob/main/maintaining-a-track/maintainer-configuration.md",
|
||||
"maintainers": []
|
||||
}
|
||||
0
docs/ABOUT.md
Normal file
0
docs/ABOUT.md
Normal file
0
docs/INSTALLATION.md
Normal file
0
docs/INSTALLATION.md
Normal file
0
docs/LEARNING.md
Normal file
0
docs/LEARNING.md
Normal file
0
docs/RESOURCES.md
Normal file
0
docs/RESOURCES.md
Normal file
0
docs/SNIPPET.txt
Normal file
0
docs/SNIPPET.txt
Normal file
0
docs/TESTS.md
Normal file
0
docs/TESTS.md
Normal file
Reference in New Issue
Block a user