Easy way to convert objects to JSON (#13) #68
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
name: CI | |
on: | |
push: | |
branches: [ main ] | |
tags: ["v*.*.*"] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macOS-latest, windows-latest ] | |
nim-version: [ "2.0.0", "2.0.2" ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: ${{ matrix.nim-version }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run unit tests | |
run: nimble unittests | |
- name: Run integation tests | |
# go-httpbin container does not run on windows runner for some reason. macos runner does not has docker by default | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: nimble inttests | |
deploy-docs: | |
needs: | |
- build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: github.event_name == 'release' && github.event.action == 'created' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: "2.0.2" | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate docs | |
run: nimble docs | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './src/htmldocs' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |