From 171aeb12504d74221d85feb7ab2c3302762af8ae Mon Sep 17 00:00:00 2001 From: Charles Lirsac Date: Tue, 28 Nov 2023 21:48:04 +0000 Subject: [PATCH] Basic Github actions --- .github/workflows/ci.yml | 84 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a64613d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,84 @@ +name: Checks +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v1 + id: setup-bun + - name: Cache node_modules + uses: actions/cache@v3 + with: + path: node_modules/ + key: ${{ runner.os }}-${{ steps.setup-bun.bun-version }}-node-modules + - name: Install deps + run: bun install + - name: Check formatting + run: bun run fmt-check + - name: ESLint + run: bun run lint + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v1 + id: setup-bun + - name: Cache node_modules + uses: actions/cache@v3 + with: + path: node_modules/ + key: ${{ runner.os }}-${{ steps.setup-bun.bun-version }}-node-modules + - name: Install deps + run: bun install + - name: Typecheck + run: bun run typecheck + build: + runs-on: ubuntu-latest + # needs: + # - lint + # - typecheck + steps: + - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v1 + id: setup-bun + - name: Cache node_modules + uses: actions/cache@v3 + with: + path: node_modules/ + key: ${{ runner.os }}-${{ steps.setup-bun.bun-version }}-node-modules + - name: Install deps + run: bun install + - name: Build + run: bun run build + - name: Archive dist + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + docker: + runs-on: ubuntu-latest + needs: + - build + steps: + - uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + - run: ls -R + - name: docker build + uses: docker/build-push-action@v5 + with: + push: false # Only checking build works for now + tags: lirsacc/siren-chorus:latest + cache-from: type=gha + cache-to: type=gha,mode=max