LoginSignup
12
6

More than 1 year has passed since last update.

GitHub Actions で Deno を使う

Last updated at Posted at 2019-12-13

Deno (ディノ) Advent Calendar 14日目の記事です.

今日は GitHub Actions で Deno を使う方法を紹介します. GitHub Actions で Deno を使うには denoland/setup-deno という Action を使います.

(Update(2022/11/27): denolib/setup-deno から denoland/setup-deno に更新しました)

使い方

使い方はとても簡単で, action の step で denoland/setup-deno@v1 を指定すれば, ホスト環境に deno コマンドがインストールされます.

jobs:
  hello:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: denoland/setup-deno@v1
        with:
          deno-version: v1.x
      - run: deno run https://deno.land/std/examples/welcome.ts

(実際にはさらに on プロパティでトリガーをセットする必要があります.)

複数の Deno バージョンでマトリックステストをしたい場合は以下のようにして実現できます.

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        deno: [v1.x, v1.25]
    name: Deno ${{ matrix.deno }} sample
    steps:
      - uses: actions/checkout@master
      - name: Setup Deno
        uses: denoland/setup-deno@v1
        with:
          deno-version: ${{ matrix.deno }}
      - run: deno run https://deno.land/std/examples/welcome.ts

Recap

今日は setup-deno を使って GitHub Actions 環境に Deno をインストールして使う方法を紹介しました.

12
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
6