CI #2861
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: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 17 * * *' | |
jobs: | |
shell-ci: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Lint shell scripts, ignoring third-party files | |
run: | | |
find . -name "*.sh" | grep -v site | grep -v vendor | grep -v node_modules | grep -v demo/demo-magic > shell_files.out | |
shellcheck $(cat shell_files.out) | |
node-ci: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest] | |
node-version: [12.x, 14.x] | |
package: [kpt-functions, create-kpt-functions, init-package, hello-world, demo-functions] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install and test NPM packages | |
run: | | |
cd ts/${{ matrix.package }} | |
npm ci | |
npm test | |
- name: Check licenses | |
if: matrix.package == 'kpt-functions' || | |
matrix.package == 'create-kpt-functions' || | |
matrix.package == 'demo-functions' | |
run: | | |
cd ts/${{ matrix.package }} | |
npm run lint-license | |
- name: Generate docs diff | |
if: matrix.package == 'kpt-functions' | |
run: | | |
cd ts/${{ matrix.package }} | |
npm run gen-docs | |
DIFF=$(git status -s) | |
[[ -z $DIFF ]] || { echo "Need to update docs: $DIFF"; } | |
go-ci: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
env: | |
GOPATH: /home/runner/work/kpt-functions-sdk/go | |
GO111MODULE: on | |
steps: | |
- name: Set up Go 1.18 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.18 | |
id: go | |
- name: Check out code into GOPATH | |
uses: actions/checkout@v1 | |
with: | |
path: go/src/github.com/GoogleContainerTools/kpt-functions-sdk | |
- name: Build, Test, Lint | |
run: hack/ci-validate-go.sh | |
- name: Test typegen | |
run: | | |
cd ts/typegen | |
make all |