Skip to content

Commit

Permalink
Merge pull request #17 from snohio/lastlink/pipeline
Browse files Browse the repository at this point in the history
Lastlink/pipeline
  • Loading branch information
lastlink authored Mar 23, 2024
2 parents b183616 + 89a72d2 commit 96eb020
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 3 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,58 @@
name: Run Basic Commands
name: Pull Request Pipeline

on:
pull_request:
# push:
# branches:
# - main # Push events on master branch

jobs:
run-commands:
# https://github.com/chef/github-workflows/blob/main/.github/workflows/yaml-lint.yml
yaml-lint:
uses: ./.github/workflows/yaml-lint.yml
build:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v1
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Checkout repository
uses: actions/checkout@v3

- run: npm install --dev
- run: npm test
- run: npm run test:coverage
- name: upload junit
uses: actions/upload-artifact@v1
with:
name: junit
path: junit.xml
- uses: ashley-taylor/[email protected]
if: always()
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
path: junit.xml
- name: upload code coverage
uses: actions/upload-artifact@v1
with:
name: Report-CodeCoverage
path: coverage

- run: npm install -g markdownlint-cli
- run: markdownlint src --disable MD001 MD013 MD033 MD045 MD026 MD041
- run: npm run build
- name: build _site
run: |
npm run build
# - name: upload _site
# uses: actions/upload-artifact@v1
# with:
# name: _site
# path: _site
29 changes: 29 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
on:
workflow_call:

jobs:
yaml-lint:
runs-on: ubuntu-latest
container: ruby:3.1-alpine
steps:
- name: Checkout Code
uses: actions/checkout@main
- name: Pull Change list
id: changed-files
uses: collin-miller/git-changesets@master
- name: Verify Changed files
id: verify-changed-files
run: |
echo '${{ steps.changed-files.outputs.added_modified }}' > changed.txt
if grep ".*\.yml\|.*\.yaml" changed.txt; then
echo "files_changed=true" >> "$GITHUB_OUTPUT"
else
echo "files_changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Run Yaml Linter
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
gem install yaml-lint
find . -type f -iname "*.yml" -exec yaml-lint \{\} \+
find . -type f -iname "*.yaml" -exec yaml-lint \{\} \+

0 comments on commit 96eb020

Please sign in to comment.