Skip to content

Commit

Permalink
bump dependencies, better caching tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nha committed Apr 1, 2024
1 parent e7d3b20 commit 6d01e77
Show file tree
Hide file tree
Showing 17 changed files with 36,467 additions and 11,077 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
Expand Down
53 changes: 47 additions & 6 deletions .github/workflows/check_url.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# name: Simple url check
on: [push]

jobs:
Expand All @@ -7,12 +6,38 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04]
os: [ubuntu-latest, windows-latest]
steps:

- name: Setup Babashka
id: setup-babashka
uses: turtlequeue/setup-babashka@feat/cache
with:
babashka-version: 1.3.189

- name: Check if bb runs fine
run: bb --version

- name: Setup Babashka from cache
id: setup-babashka-2
uses: turtlequeue/setup-babashka@feat/cache
with:
babashka-version: 1.3.189
fail-on-cache-miss: true

- name: Check if bb runs fine from cache
run: bb --version

check-url:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
babashka-url: ['https://github.com/babashka/babashka/releases/download/v1.3.189/babashka-1.3.189-linux-amd64-static.tar.gz']
steps:
- name: Setup Babashka
id: setup-babashka
uses: turtlequeue/setup-babashka@main
uses: turtlequeue/setup-babashka@feat/cache
with:
babashka-version: 1.3.189
babashka-url: ${{ matrix.babashka-url }}
Expand All @@ -22,13 +47,15 @@ jobs:

- name: Setup Babashka from cache
id: setup-babashka-2
uses: turtlequeue/setup-babashka@main
uses: turtlequeue/setup-babashka@feat/cache
with:
babashka-version: 1.3.189
babashka-url: ${{ matrix.babashka-url }}
fail-on-cache-miss: true

- name: Check if bb runs fine from cache
run: bb --version

check-windows:
# https://ci.appveyor.com/project/borkdude/babashka
runs-on: windows-latest
Expand All @@ -38,7 +65,8 @@ jobs:
steps:
- name: Setup Babashka
id: setup-babashka
uses: turtlequeue/setup-babashka@main
uses: turtlequeue/setup-babashka@feat/cache

with:
babashka-version: 1.3.190-SNAPSHOT
babashka-url: ${{ matrix.babashka-url }}
Expand All @@ -48,10 +76,23 @@ jobs:

- name: Setup Babashka from cache
id: setup-babashka-2
uses: turtlequeue/setup-babashka@main
uses: turtlequeue/setup-babashka@feat/cache

with:
babashka-version: 1.3.190-SNAPSHOT
babashka-url: ${{ matrix.babashka-url }}
fail-on-cache-miss: true

- name: Check if bb runs fine from cache
run: bb --version

- name: Test Cache
run: |
if [ -z "${{ steps.setup-babashka-1.outputs.cache-hit }}" ]; then
echo "Cache-hit output not set in first run. Failing the job."
exit 1
elif [ "${{ steps.setup-babashka-2.outputs.cache-hit }}" != "true" ]; then
echo "Cache not used in the second run. Failing the job."
exit 1
fi
shell: bash
17 changes: 13 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@ name: Main dev test
on: [push]

jobs:
simple:
runs-on: ubuntu-latest
# runs-on: windows-latest
maindevtest:
# runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Setup Babashka
uses: turtlequeue/setup-babashka@main
id: setup-babashka
uses: turtlequeue/setup-babashka@feat/cache
with:
babashka-version: 1.3.189

- name: Check bb runs
run: bb --version

- name: Test Cache
run: |
if [ -z "${{ steps.setup-babashka.outputs.cache-hit }}" ]; then
echo "Cache-hit output not set in first run. Failing the job."
exit 1
fi
shell: bash
20 changes: 16 additions & 4 deletions .github/workflows/self_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04, macos-latest, windows-latest]
babashka-version: [0.5.0, 1.1.172, 1.3.189]
os: [ubuntu-latest, macos-latest, windows-latest]
babashka-version: [1.1.172, 1.3.189]
steps:
- name: Setup Babashka
id: setup-babashka
uses: turtlequeue/setup-babashka@main
uses: turtlequeue/setup-babashka@feat/cache
with:
babashka-version: ${{ matrix.babashka-version }}

Expand All @@ -21,9 +21,21 @@ jobs:

- name: Setup Babashka from cache
id: setup-babashka-2
uses: turtlequeue/setup-babashka@main
uses: turtlequeue/setup-babashka@feat/cache
with:
babashka-version: ${{ matrix.babashka-version }}
fail-on-cache-miss: true

- name: Check if bb runs fine from cache
run: bb --version

- name: Test Cache
run: |
if [ -z "${{ steps.setup-babashka-1.outputs.cache-hit }}" ]; then
echo "Cache-hit output not set in first run. Failing the job."
exit 1
elif [ "${{ steps.setup-babashka-2.outputs.cache-hit }}" != "true" ]; then
echo "Cache not used in the second run. Failing the job."
exit 1
fi
shell: bash
14 changes: 14 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Unit Test

on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: yarn
- run: yarn test
1 change: 1 addition & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
nvm use
yarn install
yarn package
nodemon -e ts --exec yarn test
```

# Test in CI
Expand Down
Loading

0 comments on commit 6d01e77

Please sign in to comment.