-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3492 from bdach/github-actions
Add GitHub Actions workflow
- Loading branch information
Showing
4 changed files
with
1,893 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: osu-wiki continuous integration | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
ci: | ||
name: remarkjs, changed files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: sparse checkout | ||
shell: bash | ||
run: | | ||
# repository url, utilising provided github credentials | ||
REPOSITORY="https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git" | ||
# merge commit ref name (with refs/heads/ stripped out) | ||
BRANCH="${GITHUB_REF/#refs\/heads\//}" | ||
git version | ||
# clone without blobs; don't checkout to avoid fetching them anyway | ||
git clone --filter=blob:none --no-checkout ${REPOSITORY} . | ||
git config --local gc.auto 0 | ||
# set up sparse checkout | ||
git sparse-checkout init | ||
git sparse-checkout set '**/*.md' '**/.remark*' '**/*.json' | ||
# fetch the merge commit ref | ||
git -c protocol.version=2 fetch --no-tags --prune --progress --depth=2 origin +${GITHUB_SHA}:refs/remotes/origin/${BRANCH} | ||
git checkout --progress --force -B $BRANCH refs/remotes/origin/$BRANCH | ||
- name: setup node | ||
uses: actions/setup-node@v1 | ||
|
||
- name: audit dependencies | ||
run: npm audit | ||
|
||
- name: install remark | ||
run: npm install | ||
|
||
- name: run remark on changed files | ||
# stdout is discarded (remark prints files being checked there) | ||
run: git diff ${{ github.sha }}^ ${{ github.sha }} --name-only '*.md' | xargs npx remark -qf --no-stdout --report=vfile-reporter-position --color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# prevent accidental addition of files from local remark runs | ||
node_modules/ |
Oops, something went wrong.