Add first attempt at actions file #15
Workflow file for this run
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# from travis | |
# env: | |
# CHANGED_FILES: $(git diff --name-only $TRAVIS_COMMIT_RANGE) | |
jobs: | |
test: | |
runs-on: '${{ matrix.os }}' | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
node-version: | |
- 14.x | |
# outputs: | |
# all: ${{steps.changes.outputs.all}} | |
steps: | |
- name: 'Set up Node.js ${{ matrix.node-version }}' | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '${{ matrix.node-version }}' | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: v1-npm-deps- | |
- name: Checkout repository get changed files | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# run: | | |
# echo "CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" >> $GITHUB_ENV | |
# run: | | |
# echo "::set-output name=all::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" | |
- name: Run build (test, validate) | |
env: | |
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | |
CHANGED_FILES: $(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) | |
run: echo $CHANGED_FILES | |
# run: 'npm ci' | |
# run: 'npm run bootstrap && npm run build:ci' | |
publish: | |
runs-on: '${{ matrix.os }}' | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
node-version: | |
- 14.x | |
# if: ${{ github.event_name != 'pull_request' }} | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Publish Package(s) | |
run: 'npm run publish' | |
# from travis | |
# - run: >- | |
# if [[ $TRAVIS_PULL_REQUEST = "false" ]]; then PUBLISH_PACKAGE=true; | |
# else PUBLISH_PACKAGE=false; fi | |
# - run: >- | |
# echo "Pull Request: $TRAVIS_PULL_REQUEST" && echo "Node: | |
# $TRAVIS_NODE_VERSION" && echo "Publish? $PUBLISH_PACKAGE" | |
# - run: 'if [ $PUBLISH_PACKAGE = "true" ]; then npm run publish; fi' |