Update pre-submits (#289)

Signed-off-by: Ian Lewis <ianlewis@google.com>

Signed-off-by: Ian Lewis <ianlewis@google.com>
This commit is contained in:
Ian Lewis
2022-10-03 23:58:15 +09:00
committed by GitHub
parent 35fd91f381
commit 951ae240b2
3 changed files with 72 additions and 15 deletions

View File

@@ -1,27 +1,26 @@
name: Actions pre submits
on: [pull_request, workflow_dispatch]
on:
pull_request:
branches: [main]
workflow_dispatch:
permissions: read-all
jobs:
action-presubmit:
check-dist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
- name: Setup Node.js 16
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3.5.0
- name: Set Node.js 16
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3.4.1
with:
node-version: 16
- name: Install dependencies
- name: Rebuild the dist/ directory
working-directory: actions/installer
run: npm ci
- name: Run build and tests
working-directory: actions/installer
run: npm run all
run: make package
- name: Compare the expected and actual dist/ directories
working-directory: actions/installer
@@ -34,10 +33,9 @@ jobs:
exit 1
fi
# If there are uncommited changes in dist/, upload the directory
- name: Upload dist/
# If index.js was different from expected, upload the expected version as an artifact
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3.1.0
with:
name: dist
path: dist/

18
.github/workflows/pre-submit.lint.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Lint
on: [pull_request]
permissions:
# Needed to check out the repo.
contents: read
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
- uses: actions/setup-node@v3
with:
node-version: 16
- working-directory: actions/installer
run: make lint