Your music, beautifully tracked. All yours. (coming soon) teal.fm
teal-fm atproto
at main 204 lines 5.9 kB view raw
1# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json 2 3name: CI 4 5on: 6 push: 7 branches: [main, develop] 8 pull_request: 9 branches: [main, develop] 10 11env: 12 CARGO_TERM_COLOR: always 13 SQLX_OFFLINE: true 14 SQLX_OFFLINE_DIR: "./.sqlx" 15 16jobs: 17 setup-and-build: 18 name: Setup and Build All 19 runs-on: ubuntu-latest 20 outputs: 21 rust-cache-key: ${{ steps.rust-cache.outputs.cache-hit }} 22 node-cache-key: ${{ steps.node-cache.outputs.cache-hit }} 23 steps: 24 - name: Checkout repository 25 uses: actions/checkout@v4 26 27 - name: Setup environment 28 uses: ./.github/actions/setup 29 with: 30 setup-rust: "true" 31 setup-node: "true" 32 cache-key-suffix: "ci-build" 33 34 - name: Setup SQLx offline files 35 run: ./scripts/setup-sqlx-offline.sh 36 37 - name: Build Node packages 38 run: pnpm build 39 40 - name: Build Rust workspace (x86_64) 41 run: | 42 cargo build --release --all-features --workspace 43 44 - name: Collect executables (x86_64) 45 run: | 46 mkdir -p artifacts/x86_64 47 # Copy all executables from unified workspace 48 if [ -d "target/release" ]; then 49 find target/release -maxdepth 1 -type f -executable ! -name "*.d" ! -name "*-*" -exec cp {} artifacts/x86_64/ \; 50 fi 51 echo "x86_64 executables:" 52 ls -la artifacts/x86_64/ || echo "No executables found" 53 54 - name: Upload Node build artifacts 55 uses: actions/upload-artifact@v4 56 with: 57 name: node-builds 58 path: | 59 packages/*/dist/ 60 apps/amethyst/build/ 61 retention-days: 1 62 63 - name: Upload Rust build artifacts 64 uses: actions/upload-artifact@v4 65 with: 66 name: rust-builds-x86_64 67 path: | 68 artifacts/x86_64/ 69 retention-days: 1 70 71 rust-cross-compile: 72 name: Cross-compile Rust 73 runs-on: ubuntu-latest 74 needs: setup-and-build 75 strategy: 76 matrix: 77 target: [aarch64-unknown-linux-gnu] 78 steps: 79 - name: Checkout repository 80 uses: actions/checkout@v4 81 82 - name: Setup environment 83 uses: ./.github/actions/setup 84 with: 85 setup-rust: "true" 86 setup-node: "true" 87 lexicons-only-rust: "true" 88 cache-key-suffix: "cross-${{ matrix.target }}" 89 90 - name: Setup SQLx offline files 91 run: ./scripts/setup-sqlx-offline.sh 92 93 - name: Install cross-compilation tools 94 run: | 95 cargo install cross --git https://github.com/cross-rs/cross 96 rustup target add ${{ matrix.target }} 97 # Set up environment for cross-compilation 98 echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV 99 echo "CROSS_NO_WARNINGS=0" >> $GITHUB_ENV 100 101 - name: Cross-compile workspace 102 run: | 103 cross build --release --all-features --workspace --target ${{ matrix.target }} 104 105 - name: Collect cross-compiled executables 106 run: | 107 mkdir -p artifacts/${{ matrix.target }} 108 # Copy all executables from unified workspace 109 if [ -d "target/${{ matrix.target }}/release" ]; then 110 find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable ! -name "*.d" ! -name "*-*" -exec cp {} artifacts/${{ matrix.target }}/ \; 111 fi 112 echo "Cross-compiled executables for ${{ matrix.target }}:" 113 ls -la artifacts/${{ matrix.target }}/ || echo "No executables found" 114 115 - name: Upload cross-compiled artifacts 116 uses: actions/upload-artifact@v4 117 with: 118 name: rust-builds-${{ matrix.target }} 119 path: | 120 artifacts/${{ matrix.target }}/ 121 retention-days: 1 122 123 # disabled b/c it's triggered on autogenerated content 124 # and can't find a way around it rn 125 126 # rust-quality: 127 # name: Rust Quality Checks 128 # runs-on: ubuntu-latest 129 # needs: setup-and-build 130 # steps: 131 # - name: Checkout repository 132 # uses: actions/checkout@v4 133 134 # - name: Setup environment 135 # uses: ./.github/actions/setup 136 # with: 137 # setup-rust: "true" 138 # setup-node: "true" 139 # lexicons-only-rust: "true" 140 # cache-key-suffix: "ci-build" 141 142 # - name: Setup SQLx offline files 143 # run: ./scripts/setup-sqlx-offline.sh 144 145 # # - name: Check Rust formatting 146 # # run: | 147 # # cargo fmt --all -- --check 148 149 # - name: Run Clippy 150 # run: | 151 # cargo clippy --all-targets --all-features --workspace --exclude types -- -D warnings 152 153 # - name: Run Rust tests 154 # run: | 155 # cargo test --all-features 156 157 # node-quality: 158 # name: Node.js Quality Checks 159 # runs-on: ubuntu-latest 160 # needs: setup-and-build 161 # steps: 162 # - name: Checkout repository 163 # uses: actions/checkout@v4 164 165 # - name: Setup environment 166 # uses: ./.github/actions/setup 167 # with: 168 # setup-node: "true" 169 # cache-key-suffix: "ci-build" 170 171 # - name: Download Node build artifacts 172 # uses: actions/download-artifact@v4 173 # with: 174 # name: node-builds 175 # path: . 176 177 # # - name: Type check 178 # # run: pnpm typecheck 179 180 # - name: Lint and format check 181 # run: pnpm fix --check 182 183 # - name: Run tests 184 # run: pnpm test 185 186 lexicon-validation: 187 name: Lexicon Validation 188 runs-on: ubuntu-latest 189 steps: 190 - name: Checkout repository 191 uses: actions/checkout@v4 192 193 - name: Setup environment 194 uses: ./.github/actions/setup 195 with: 196 setup-node: "true" 197 198 - name: Validate lexicons 199 run: pnpm lex:validate 200 201 - name: Check lexicon generation consistency 202 run: | 203 pnpm lex:gen 204 git diff --exit-code || (echo "Lexicon files are out of sync. Run 'pnpm lex:gen' locally." && exit 1)