Skip to content

Merge pull request #3 from ltfschoen/yml #17

Merge pull request #3 from ltfschoen/yml

Merge pull request #3 from ltfschoen/yml #17

Workflow file for this run

# example workflows:
# https://github.com/actions/checkout/tree/main/.github/workflows
#
# context: https://docs.docker.com/build/ci/github-actions/named-contexts/
name: dev
on:
push:
branches:
- main
paths-ignore:
- 'node_module/**'
pull_request:
branches:
- main
paths-ignore:
- 'node_module/**'
jobs:
# run our deno cli app against the demo template ts file and demo manifest file
run:
runs-on: ubuntu-latest
steps:
- name: Install Unzip and Curl required to setup Deno
run: |
apt-get update -y && apt-get upgrade -y \
&& apt-get install unzip curl -y
- name: Setup Deno
uses: denoland/setup-deno@v1.1.4
with:
deno-version: v1.43.6
- name: Install CodeKarma using Deno Install
# https://docs.deno.com/runtime/manual/tools/script_installer
# creates executable called codekarma_cli that runs with network
# and read permissions and binds to port 5000
#
# deno install -g \
# --allow-net --allow-read \
# --root /usr/local \
# --name codekarma_cli https://raw.githubusercontent.com/ltfschoen/ethberlin04/main/src/main.ts -- -p 5000
#
# deno run --help
# curl file:///codekarma/src.main.ts | deno run -
# WORKS - curl https://raw.githubusercontent.com/ltfschoen/ethberlin04/main/src/main.ts | deno run -
run: |
echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
deno install -g \
--allow-net --allow-read \
--root /codekarma \
--name codekarma_cli https://raw.githubusercontent.com/ltfschoen/ethberlin04/main/src/main.ts -- -p 5000
- name: Troubleshooting using `deno run` instead to try to avoid getting error `Couldn't open file /codekarma/src/main.ts`
run: |
curl file:///codekarma/src/main.ts | deno run -
- name: Troubleshooting to try to check why getting error `Couldn't open file /codekarma/src/main.ts`
run: |
touch /codekarma/log.txt
status=$(echo $PWD > /codekarma/log.txt 2>&1; echo $?)
cat /codekarma/log.txt
echo ::set-output name=status::$status
# Compare desired manifest or plugin compliance expectations with
# latest watched file change in demo template repo in build directory
- name: Detect and report non-compliance with manifest or plugin registry
run: |
/codekarma/codekarma_cli | grep '❌' &> /dev/null
if [ $? == 0 ]; then
echo "Detected compliance warning after file change in latest build. See report below:"
/codekarma/codekarma_cli
exit 1
fi
# https://stackoverflow.com/a/69563128/3208553
- name: Check run status
if: steps.run.outputs.status != '0'
run: exit "${{ steps.run.outputs.status }}"
# # If we detected a non-compliance warning in the source file .ts or
# # compiled .js in dist/ folder then upload the non-compliance as an artifact
# - uses: actions/upload-artifact@v4
# if: ${{ failure() && steps.diff.conclusion == 'failure' }}
# with:
# name: dist
# path: dist/