Skip to content

build(deps): update jiro4989/setup-nim-action action to v2 #558

build(deps): update jiro4989/setup-nim-action action to v2

build(deps): update jiro4989/setup-nim-action action to v2 #558

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Setup Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: '1.4.2'
- name: Build
run: nimble build
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: zws
path: zws
lint-dockerfile:
name: Lint Dockerfile
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Lint Dockerfile
uses: brpaz/hadolint-action@v1.5.0
with:
dockerfile: 'Dockerfile'
style:
name: Check style
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Check style
run: yarn run style
test-docker:
name: Test Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build
id: docker_build
uses: docker/build-push-action@v5
with:
pull: true
load: true
tags: zwsim/cli:latest
- name: Start
run: docker run zwsim/cli
deploy:
name: Deploy
runs-on: ubuntu-latest
# Don't run this job if we aren't on master branch
# `semantic-release` will do this automatically, but this saves us the time of building the image prior to that
if: ${{ github.ref == 'refs/heads/main' }}
needs: [build, lint-dockerfile, test-docker]
steps:
- name: Checkout git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Setup Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: '1.4.2'
- name: Install C build toolchain
run: sudo apt-get install mingw-w64 gcc-multilib
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Deploy
run: yarn run deploy
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}