Last active
February 17, 2023 09:15
-
-
Save jeremyBanks/82d36ada677bec9968e49ae7cb89b964 to your computer and use it in GitHub Desktop.
GitHub Actions workflow for Deno
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: Deno | |
on: | |
- push | |
- pull_request | |
jobs: | |
deno: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: cache deno installation and deno.land dependencies | |
uses: actions/cache@v2 | |
with: | |
key: ${{ runner.os }}-deno-${{ hashFiles('**/*') }} | |
restore-keys: ${{ runner.os }}-deno- | |
path: | | |
/home/runner/.deno | |
/home/runner/.cache/deno/deps/https/deno.land | |
- name: install or update deno installation | |
run: | | |
export DENO_INSTALL="/home/runner/.deno" | |
export PATH="${DENO_INSTALL}/bin:${PATH}" | |
mkdir -p "${DENO_INSTALL}" | |
deno upgrade || ( | |
curl -fsSL https://deno.land/x/install/install.sh > "${DENO_INSTALL}/.sh"; | |
sh "${DENO_INSTALL}/.sh" | |
) | |
echo "DENO_INSTALL=${DENO_INSTALL}" >> $GITHUB_ENV | |
echo "PATH=${PATH}" >> $GITHUB_ENV | |
- name: fetch any uncached dependencies | |
run: | | |
deno cache --reload=file: ./mod.ts | |
- run: | | |
deno info ./mod.ts | |
- run: | | |
deno test --allow-none | |
- name: check lint | |
continue-on-error: true | |
run: | | |
deno --unstable lint | |
- name: check formatting | |
continue-on-error: true | |
run: | | |
deno fmt --check | |
- name: check lock file | |
continue-on-error: true | |
run: | | |
if [[ -f lock.json ]]; then | |
deno cache --lock=lock.json --cached-only ./mod.ts | |
fi | |
deno cache --lock-write --lock=lock.json ./mod.ts | |
cat lock.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you please update config with
setup-deno
?