swuecho / sqlc-fs

sqlc (postgresql) plugin for f#
0 stars 0 forks source link

create a test in F# #3

Closed swuecho closed 1 year ago

swuecho commented 1 year ago

Sure! Here are the steps to create a GitHub Action for F#:

  1. Create a new repository for your GitHub Action on GitHub.

  2. Create a new directory in the root of your repository called .github/workflows. Inside this directory, create a new YAML file called fsharp.yml.

  3. In the fsharp.yml file, add the following code:

name: F# workflow

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '3.1'
    - name: Build with dotnet
      run: dotnet build --configuration Release --no-restore

This YAML file defines a GitHub Action that runs when code is pushed to the repository. The action runs on Ubuntu and builds the project using dotnet.

  1. Commit the changes and push them to your repository.

  2. Congratulations! You have created a GitHub Action for F#.

To use your GitHub Action, you can include it in the workflow file for your other projects:

name: My Awesome Workflow

on: [push]

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Build with F#
      uses: {your-username}/{your-repository-name}@master

Replace {your-username} and {your-repository-name} with your GitHub username and the name of your repository, respectively.

That's it! Now whenever code is pushed to your repository, your F# GitHub Action will be triggered.