Эх сурвалжийг харах

enable github ci (#3)

* enable github ci

* 1
LoGin 2 сар өмнө
parent
commit
921c834a6f
1 өөрчлөгдсөн 12 нэмэгдсэн , 16 устгасан
  1. 12 16
      .github/workflows/ci.yml

+ 12 - 16
.github/workflows/ci.yml

@@ -1,12 +1,12 @@
 name: CI
 on:
-  push: {}
-  pull_request: {}
+  push:
+    branches: [ "master" ]
+  pull_request:
+    branches: [ "master" ]
   schedule:
     - cron: "0 12 * * 1" # Every Monday at 12:00 UTC
 
-env:
-  AWS_ACCESS_KEY_ID: AKIA46X5W6CZEAQSMRH7
 
 jobs:
   rustfmt:
@@ -28,16 +28,12 @@ jobs:
           fetch-depth: 1
 
       - name: Test and build
-        run: docker build -t triagebot .
+        shell: bash -ileo pipefail {0}
+        run: |
+            apt-get update -y
+            DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends g++ curl ca-certificates libc6-dev make libssl-dev pkg-config git cmake zlib1g-dev
+            curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal -y
+
+            cargo test --release --all
+            cargo build --release
 
-      - name: Deploy to production
-        uses: rust-lang/simpleinfra/github-actions/upload-docker-image@master
-        with:
-          image: triagebot
-          repository: rust-triagebot
-          region: us-west-1
-          redeploy_ecs_cluster: rust-ecs-prod
-          redeploy_ecs_service: triagebot
-          aws_access_key_id: "${{ env.AWS_ACCESS_KEY_ID }}"
-          aws_secret_access_key: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
-        if: github.ref == 'refs/heads/master'