Update to latest version (#7)
This commit is contained in:
64
.github/workflows/ci.yml
vendored
64
.github/workflows/ci.yml
vendored
@@ -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
|
||||
68
.github/workflows/pr.ci.yml
vendored
68
.github/workflows/pr.ci.yml
vendored
@@ -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
39
.github/workflows/test.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user