LoginSignup
0
0

個人的「質はともかく継続する」16日目です

GitHub Actionsで言語を実行する

最近まで知らなかったのですが、GitHub ActionsでPython等の言語を実行することができるんだそう。よく考えれば、大体はUbuntuを仮想で動かしてるんだから当然の話しですよね。
早速、Pythonを動かすymlを書いてみました。

Pythonを動かす

以下のように書けばpythonを動かせます。

jobs:

  build:
    runs-on: ubuntu-latest

    steps:
     
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.x'

    - name: Run Script
      run: |
            python <<EOF
            import os
            print("Python動かせます")
            for f in os.listdir():
                print(f)
            EOF

結果。

image.png

Javaとか、.NET SDKもあるようなので色々と使えそうですね。
普段業務で使うことが少ないので、ちょっとずつ学習していこうかな。

0
0
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
0
0