2021-06-09 20:31:45 +02:00
|
|
|
name: 'ci'
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- uses: 'actions/checkout@v2'
|
|
|
|
|
|
|
|
- name: 'Use Node.js'
|
2021-11-30 14:51:20 +01:00
|
|
|
uses: 'actions/setup-node@v2.5.0'
|
2021-06-09 20:31:45 +02:00
|
|
|
with:
|
|
|
|
node-version: '16.x'
|
2021-07-01 10:00:18 +02:00
|
|
|
cache: 'npm'
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- name: 'Install'
|
2021-07-01 10:00:18 +02:00
|
|
|
run: 'npm install'
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- run: 'npm run lint:commit -- --to "${{ github.sha }}"'
|
|
|
|
- run: 'npm run lint:editorconfig'
|
|
|
|
- run: 'npm run lint:markdown'
|
|
|
|
- run: 'npm run lint:typescript'
|
|
|
|
|
|
|
|
build:
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- uses: 'actions/checkout@v2'
|
|
|
|
|
|
|
|
- name: 'Use Node.js'
|
2021-11-30 14:51:20 +01:00
|
|
|
uses: 'actions/setup-node@v2.5.0'
|
2021-06-09 20:31:45 +02:00
|
|
|
with:
|
|
|
|
node-version: '16.x'
|
2021-07-01 10:00:18 +02:00
|
|
|
cache: 'npm'
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- name: 'Install'
|
2021-07-01 10:00:18 +02:00
|
|
|
run: 'npm install'
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- name: 'Build'
|
|
|
|
run: 'npm run build'
|
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- uses: 'actions/checkout@v2'
|
|
|
|
|
2021-12-06 17:18:14 +01:00
|
|
|
- name: 'Use Docker'
|
|
|
|
uses: 'actions-hub/docker/cli@master'
|
|
|
|
env:
|
|
|
|
SKIP_LOGIN: true
|
|
|
|
|
2021-06-09 20:31:45 +02:00
|
|
|
- name: 'Use Node.js'
|
2021-11-30 14:51:20 +01:00
|
|
|
uses: 'actions/setup-node@v2.5.0'
|
2021-06-09 20:31:45 +02:00
|
|
|
with:
|
|
|
|
node-version: '16.x'
|
2021-07-01 10:00:18 +02:00
|
|
|
cache: 'npm'
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- name: 'Install'
|
2021-07-01 10:00:18 +02:00
|
|
|
run: 'npm install'
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- name: 'Test'
|
|
|
|
run: 'npm run test'
|
|
|
|
|
|
|
|
challenges:
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- uses: 'actions/checkout@v2'
|
2021-06-25 13:02:34 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- name: 'Use Docker'
|
|
|
|
uses: 'actions-hub/docker/cli@master'
|
|
|
|
env:
|
|
|
|
SKIP_LOGIN: true
|
|
|
|
|
|
|
|
- name: 'Use Node.js'
|
2021-11-30 14:51:20 +01:00
|
|
|
uses: 'actions/setup-node@v2.5.0'
|
2021-06-09 20:31:45 +02:00
|
|
|
with:
|
|
|
|
node-version: '16.x'
|
2021-07-01 10:00:18 +02:00
|
|
|
cache: 'npm'
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- name: 'Install'
|
2021-07-01 10:00:18 +02:00
|
|
|
run: 'npm install'
|
2021-06-09 20:31:45 +02:00
|
|
|
|
|
|
|
- name: 'Build'
|
|
|
|
run: 'npm run build'
|
|
|
|
|
|
|
|
- name: 'Install programming-challenges'
|
|
|
|
run: 'npm install --global'
|
|
|
|
|
2021-06-30 15:23:58 +02:00
|
|
|
- uses: 'nrwl/last-successful-commit-action@v1'
|
|
|
|
id: 'last_successful_commit'
|
|
|
|
with:
|
|
|
|
branch: 'master'
|
|
|
|
workflow_id: 'ci.yml'
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2021-06-09 20:31:45 +02:00
|
|
|
- name: 'Test'
|
2021-06-30 15:23:58 +02:00
|
|
|
run: 'programming-challenges run test --affected --ci --base=${{ steps.last_successful_commit.outputs.commit_hash }}'
|