Migrate to bun #1067
Workflow file for this run
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: | |
pull_request: | |
branches: [ master ] | |
push: | |
branches: [ master ] | |
env: | |
DOCKER_BUILDKIT: "1" | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
fetch-depth: 0 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- run: bun install | |
- run: npm run ci | |
build: | |
name: Build + Smoke Test | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- name: Build and export | |
uses: docker/build-push-action@v5 | |
with: | |
tags: csz-bot:latest | |
load: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Update configuration | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
cp .github/config.json config.json | |
sed -i 's/<BOT_TOKEN>/${{ secrets.CI_BOT_TOKEN }}/g' config.json | |
sed -i 's/<CLIENT_ID>/${{ secrets.CI_CLIENT_ID }}/g' config.json | |
cp .github/aoc.config.json aoc.config.json | |
- name: Check if bot starts correctly | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
docker run \ | |
--rm \ | |
-v "$PWD/config.json:/app/config.json" \ | |
-v "$PWD/aoc.config.json:/app/aoc.config.json" \ | |
csz-bot:latest --dry-run | |