-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (79 loc) · 3.11 KB
/
dev.yml
File metadata and controls
84 lines (79 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# 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/