|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | +permissions: |
| 9 | + checks: write |
| 10 | + contents: write |
| 11 | + id-token: write |
| 12 | +# concurrency: |
| 13 | +# group: ${{ github.workflow }}-${{ github.ref_name }} |
| 14 | +# cancel-in-progress: true |
| 15 | +jobs: |
| 16 | + compatibility: |
| 17 | + name: Check Dependency Compatibility |
| 18 | + runs-on: ubuntu-latest |
| 19 | + environment: |
| 20 | + name: code_quality |
| 21 | + steps: |
| 22 | + - name: Checkout repository |
| 23 | + uses: actions/checkout@v5.0.0 |
| 24 | + - name: Install Nix |
| 25 | + uses: DeterminateSystems/determinate-nix-action@1d699fc25db3f9e079cd2f168ca007a4183389be # v3.15.1 |
| 26 | + with: |
| 27 | + logger: pretty |
| 28 | + - name: Cache |
| 29 | + uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13 |
| 30 | + - name: Install devenv.sh |
| 31 | + run: nix profile install nixpkgs#devenv |
| 32 | + - name: Check Compatibility |
| 33 | + run: devenv shell compatibility-check |
| 34 | + test: |
| 35 | + name: Run Tests |
| 36 | + runs-on: ubuntu-latest |
| 37 | + environment: |
| 38 | + name: code_quality |
| 39 | + steps: |
| 40 | + - name: Checkout repository |
| 41 | + uses: actions/checkout@v5.0.0 |
| 42 | + with: |
| 43 | + token: ${{ secrets.GH_TOKEN }} |
| 44 | + - name: Install Nix |
| 45 | + uses: DeterminateSystems/determinate-nix-action@1d699fc25db3f9e079cd2f168ca007a4183389be # v3.15.1 |
| 46 | + with: |
| 47 | + logger: pretty |
| 48 | + - name: Cache |
| 49 | + uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13 |
| 50 | + - name: Install devenv.sh |
| 51 | + run: nix profile install nixpkgs#devenv |
| 52 | + - name: Test |
| 53 | + run: devenv test |
| 54 | + - name: Commit pre-commit fixes |
| 55 | + uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0 |
| 56 | + if: success() || failure() |
| 57 | + with: |
| 58 | + commit_message: "devenv: Apply Fixes" |
| 59 | + commit_options: --no-verify |
| 60 | + build_web: |
| 61 | + name: Build Web |
| 62 | + runs-on: ubuntu-latest |
| 63 | + needs: [compatibility, test] |
| 64 | + environment: |
| 65 | + name: build |
| 66 | + steps: |
| 67 | + - name: Checkout repository |
| 68 | + uses: actions/checkout@v5.0.0 |
| 69 | + - name: Install Nix |
| 70 | + uses: DeterminateSystems/determinate-nix-action@1d699fc25db3f9e079cd2f168ca007a4183389be # v3.15.1 |
| 71 | + with: |
| 72 | + logger: pretty |
| 73 | + - name: Cache |
| 74 | + uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13 |
| 75 | + - name: Install devenv.sh |
| 76 | + run: nix profile install nixpkgs#devenv |
| 77 | + - name: Cache .web |
| 78 | + uses: actions/cache@v5.0.1 |
| 79 | + with: |
| 80 | + path: .web |
| 81 | + key: ${{ runner.os }}-reflex-${{ hashFiles('**/uv.lock') }} |
| 82 | + restore-keys: ${{ runner.os }}-reflex- |
| 83 | + - name: Build Web |
| 84 | + run: devenv shell build-web |
| 85 | + - name: Upload artifact |
| 86 | + uses: actions/upload-pages-artifact@v4.0.0 |
| 87 | + with: |
| 88 | + path: .web/build/client/ |
| 89 | + deploy_web: |
| 90 | + name: Deploy Web |
| 91 | + runs-on: ubuntu-latest |
| 92 | + needs: build_web |
| 93 | + permissions: |
| 94 | + pages: write |
| 95 | + environment: |
| 96 | + name: github-pages |
| 97 | + url: ${{ steps.deployment.outputs.page_url }} |
| 98 | + if: github.event_name != 'pull_request' |
| 99 | + steps: |
| 100 | + - name: Deploy to GitHub Pages |
| 101 | + id: deployment |
| 102 | + uses: actions/deploy-pages@v4.0.5 |
0 commit comments