-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
|
||
env: | ||
DENO_DIR: my_cache_directory | ||
|
||
jobs: | ||
health: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
|
||
- name: Cache Deno dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.DENO_DIR }} | ||
key: ${{ hashFiles('lock.json') }} | ||
|
||
- name: Format | ||
run: deno fmt --check | ||
|
||
- name: Lint | ||
run: deno lint | ||
|
||
- name: Test | ||
run: deno test --allow-net=registry.npmjs.org | ||
|
||
working_package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
|
||
- name: Cache Deno dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.DENO_DIR }} | ||
key: ${{ hashFiles('lock.json') }} | ||
|
||
- run: | | ||
deno run \ | ||
--allow-net=registry.npmjs.org \ | ||
--allow-read=. \ | ||
./main.ts \ | ||
./package_valid.json \ | ||
--verbose --cache | ||
failing_peer: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
with: | ||
deno-version: v1.x | ||
|
||
- name: Cache Deno dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.DENO_DIR }} | ||
key: ${{ hashFiles('lock.json') }} | ||
|
||
- run: | | ||
deno run \ | ||
--allow-net=registry.npmjs.org \ | ||
--allow-read=. \ | ||
./main.ts \ | ||
./package.json \ | ||
--verbose --cache | ||
- name: The job has failed, which is expected | ||
if: ${{ failure() }} | ||
run: exit 0 | ||
|
||
- name: The job has succeeded, which is wrong | ||
if: ${{ success() }} | ||
run: exit 1 | ||
|
||
final: | ||
needs: [health, working_package, failing_peer] | ||
|
||
steps: | ||
- name: "All good" | ||
run: exit 0 |