From 023fd63614fddd69a622faa28fd9de4d9c088189 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 28 Aug 2023 06:54:26 +0200 Subject: [PATCH] Run a test build on push --- .forgejo/workflows/test-build.yaml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .forgejo/workflows/test-build.yaml diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml new file mode 100644 index 000000000..d36ea5847 --- /dev/null +++ b/.forgejo/workflows/test-build.yaml @@ -0,0 +1,41 @@ +on: + - push +jobs: + test-build: + runs-on: docker + container: + image: alpine:3.18 + options: --volume /opt/iceshrimp-cache/yarn:/iceshrimp-caches/yarn --volume /opt/iceshrimp-cache/cargo:/root/.cargo --volume /opt/iceshrimp-cache/built:/iceshrimp-caches/built --volume /opt/iceshrimp-cache/target:/iceshrimp-caches/target + services: + database: + image: postgres:15 + env: + POSTGRES_PASSWORD: "test" + redis: + image: redis + steps: + - name: Set up build environment + run: | + apk add --no-cache --no-progress git alpine-sdk vips-dev python3 nodejs-current npm rust cargo vips + corepack enable && corepack prepare yarn@stable --activate + - name: Clone repository + run: git clone https://iceshrimp.dev/iceshrimp/iceshrimp.git --branch=${{ github.ref_name }} --depth=1 /iceshrimp + - name: Install build dependencies + run: | + cd /iceshrimp + cp -Tr /iceshrimp-caches/yarn .yarn + yarn + rm -rf /iceshrimp-caches/yarn/* && cp -Tr .yarn /iceshrimp-caches/yarn + - name: Build the shrimp + run: | + cd /iceshrimp + cp -Trp /iceshrimp-caches/built packages/backend/native-utils/built + cp -Trp /iceshrimp-caches/target packages/backend/native-utils/target + yarn build + rm -rf /iceshrimp-caches/built/* && cp -Trp packages/backend/native-utils/built /iceshrimp-caches/built + rm -rf /iceshrimp-caches/target/* && cp -Trp packages/backend/native-utils/target /iceshrimp-caches/target + - name: Test the shrimp + run: | + cd /iceshrimp + cp .config/ci.yml .config/default.yml + yarn run migrate