|
| 1 | +name: "test build" |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | +jobs: |
| 9 | + test-ubuntu: |
| 10 | + name: Testing ubuntu-latest |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + - uses: actions/cache@v3 |
| 15 | + with: |
| 16 | + path: | |
| 17 | + ~/.cargo/bin/ |
| 18 | + ~/.cargo/registry/index/ |
| 19 | + ~/.cargo/registry/cache/ |
| 20 | + ~/.cargo/git/db/ |
| 21 | + target/ |
| 22 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 23 | + - uses: actions-rs/toolchain@v1 |
| 24 | + with: |
| 25 | + toolchain: stable |
| 26 | + - run: cargo build --release --verbose |
| 27 | + - name: Upload artifacts |
| 28 | + uses: actions/upload-artifact@v2 |
| 29 | + with: |
| 30 | + name: sqlite-regex-ubuntu |
| 31 | + path: target/release/libregex0.so |
| 32 | + test-macos: |
| 33 | + name: Testing macos-latest |
| 34 | + runs-on: macos-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v2 |
| 37 | + - uses: actions/cache@v3 |
| 38 | + with: |
| 39 | + path: | |
| 40 | + ~/.cargo/bin/ |
| 41 | + ~/.cargo/registry/index/ |
| 42 | + ~/.cargo/registry/cache/ |
| 43 | + ~/.cargo/git/db/ |
| 44 | + target/ |
| 45 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 46 | + - uses: actions-rs/toolchain@v1 |
| 47 | + with: |
| 48 | + toolchain: stable |
| 49 | + - run: cargo build --release --verbose |
| 50 | + #- run: make test |
| 51 | + - name: Upload artifacts |
| 52 | + uses: actions/upload-artifact@v2 |
| 53 | + with: |
| 54 | + name: sqlite-regex-macos |
| 55 | + path: target/release/libregex0.dylib |
| 56 | + test-windows: |
| 57 | + name: Testing windows-latest |
| 58 | + runs-on: windows-latest |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v2 |
| 61 | + - uses: actions/cache@v3 |
| 62 | + with: |
| 63 | + path: | |
| 64 | + ~/.cargo/bin/ |
| 65 | + ~/.cargo/registry/index/ |
| 66 | + ~/.cargo/registry/cache/ |
| 67 | + ~/.cargo/git/db/ |
| 68 | + target/ |
| 69 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 70 | + - uses: actions-rs/toolchain@v1 |
| 71 | + with: |
| 72 | + toolchain: stable |
| 73 | + - run: cargo build --release --verbose |
| 74 | + #- run: make test |
| 75 | + - name: Upload artifacts |
| 76 | + uses: actions/upload-artifact@v2 |
| 77 | + with: |
| 78 | + name: sqlite-regex-windows |
| 79 | + path: target/release/regex0.dll |
| 80 | + upload: |
| 81 | + name: upload to unstable |
| 82 | + needs: [test-macos, test-ubuntu, test-windows] |
| 83 | + permissions: |
| 84 | + contents: write |
| 85 | + runs-on: ubuntu-latest |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v2 |
| 88 | + - name: Download workflow artifacts |
| 89 | + uses: actions/download-artifact@v2 |
| 90 | + - uses: actions/github-script@v6 |
| 91 | + with: |
| 92 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 93 | + script: | |
| 94 | + const script = require('.github/workflows/upload.js') |
| 95 | + await script({github, context}) |
0 commit comments