Add first attempt at actions file #16
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 | ||
- name: Run build (test, validate) | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
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: | | ||
Check failure on line 43 in .github/workflows/build.yml GitHub Actions / .github/workflows/build.ymlInvalid workflow file
|
||
echo "CHANGED_FILES=$(git diff --name-only $COMMIT_RANGE)" >> $GITHUB_ENV | ||
run: echo $CHANGED_FILES | ||
run: echo env | ||
# 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' | ||
# run: | | ||
# echo "::set-output name=all::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" | ||
# 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' |