feat: Add Zulip notifications #593
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
name: CI | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.adoc' | |
push: | |
branches: | |
- main | |
- 'v*' | |
paths-ignore: | |
- '**.adoc' | |
jobs: | |
build: | |
name: Build all actions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache | |
uses: actions/cache@v2 | |
if: ${{ !env.ACT }} | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install | |
- name: Check formatting | |
run: yarn run format-check | |
- name: ESLint | |
run: yarn run lint | |
- name: Build | |
run: yarn run build | |
- name: Package | |
run: yarn run package | |
- name: Check if */dist/ updated | |
id: git-dirty | |
run: | | |
STATUS=$(git status --porcelain) | |
echo "::set-output name=status::${STATUS//$'\n'/\\n}" | |
- name: Configure git user | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Add */dist/ files and commit | |
if: ${{ steps.git-dirty.outputs.status != '' }} | |
run: | | |
git add */dist/* | |
git status | |
git commit -m "chore(dist): Update */dist/ files" | |
- name: Verify no uncommitted files left | |
run: | | |
if [[ "$(git status --porcelain)" != "" ]]; then | |
echo ---------------------------------------- | |
echo git status | |
echo ---------------------------------------- | |
git status | |
echo ---------------------------------------- | |
echo git diff | |
echo ---------------------------------------- | |
git diff | |
echo ---------------------------------------- | |
echo Troubleshooting | |
echo ---------------------------------------- | |
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && yarn install && yarn run all" | |
exit 1 | |
fi | |
- name: Push changes to ${{ github.ref }} | |
if: ${{ steps.git-dirty.outputs.status != '' && github.event_name == 'push' && !env.ACT }} | |
run: git push | |
test-find-prs: | |
name: Test find-prs action | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./find-prs | |
id: find-prs | |
with: | |
commit-sha: ${{ github.sha }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Action output | |
run: echo '${{ steps.find-prs.outputs.prs }}' | jq . | |
test-nexus: | |
name: Test nexus aciton | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./nexus | |
id: nexus | |
with: | |
base-url: https://nexus.example.com | |
repos: | | |
[ { | |
"id": "nexus", | |
"repo": "public", | |
"auth": true, | |
"releases": {"enabled": true, "checksumPolicy": "warn"}, | |
"snapshots": {"enabled": true, "checksumPolicy": "warn"} | |
}, { | |
"id": "nexus-thirdparty", | |
"repo": "thirdparty", | |
"auth": true, | |
"releases": {"enabled": true, "checksumPolicy": "warn"}, | |
"snapshots": {"enabled": false} | |
} ] | |
plugin-repos: | | |
[ { | |
"id": "nexus", | |
"repo": "public", | |
"auth": true, | |
"releases": {"enabled": true, "checksumPolicy": "warn"}, | |
"snapshots": {"enabled": false} | |
} ] | |
- name: Action output | |
run: cat ~/.m2/settings.xml |