Bump actions/setup-node from 3 to 4 (#5) #24
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: | |
types: [ opened, synchronize, reopened ] | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
test-action: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate hash | |
id: generate | |
uses: ./ | |
with: | |
build_context: ./test/ | |
extra_tree_objects: | | |
test/.dockerignore | |
test/Dockerfile | |
# Expected hash generated from command below | |
# git ls-tree -r --format='%(objectname) %(path)' --full-tree HEAD \ | |
# test/a/b \ | |
# test/context/file \ | |
# test/filename \ | |
# test/.dockerignore \ | |
# test/Dockerfile | \ | |
# git hash-object --stdin | |
- name: Check | |
run: | | |
echo "${{ toJson(steps.generate) }}" | |
if [ "${{ steps.generate.outputs.hash }}" != "6c867c528d4bf0844d5176f78f6abfee0adfff2b" ]; then | |
echo "::error::Invalid hash value" | |
exit 1 | |
fi | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16.x' | |
- run: npm ci | |
- run: npm run lint | |
- run: npm test | |
# TODO: Coverage |