ci: add CI (#21)

* ci: add ci

* ci: add lint and fmt

* build: add dockerfile

* ci: change version

* ci: deno check

* build: add .gitattributes

* ci: use glob

* ci: add pr
main
imspace 2022-11-16 20:47:01 +08:00 committed by GitHub
parent 068daa15bd
commit 239db3b2f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 75 additions and 26 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
cache/
export/
*.json

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=auto eol=lf

30
.github/workflows/ci.yaml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
deno: [1.x, "1.21.x", canary]
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}
- name: Check fmt
run: deno fmt --check
- name: Run lint
run: deno lint
- name: All entries
uses: tj-actions/glob@v16
id: entries
with:
files: |
s3si.ts
initRank.ts
./scripts/*.ts
- name: Check entries
run: deno check ${{ steps.entries.outputs.paths }}
- name: Run tests
run: deno test

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM denoland/deno:1.26.2
WORKDIR /app
# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
# Ideally cache deps.ts will download and compile _all_ external files used in main.ts.
COPY deps.ts .
RUN deno cache deps.ts
# These steps will be re-run upon each file change in your working directory:
ADD . .
# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache s3si.ts
CMD ["run", "-A", "s3si.ts", "-n"]