|
1 | 1 | name: CI |
2 | 2 |
|
3 | | -on: [pull_request, push] |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
4 | 8 |
|
5 | | -# Cancel a job if there's a new on on the same branch started. |
| 9 | +# Cancel a job if there's a new one on the same branch started. |
6 | 10 | # Based on https://stackoverflow.com/questions/58895283/stop-already-running-workflow-job-in-github-actions/67223051#67223051 |
7 | 11 | concurrency: |
8 | 12 | group: ${{ github.ref }} |
@@ -48,15 +52,31 @@ jobs: |
48 | 52 | - name: Run cargo release build |
49 | 53 | run: cargo build --release |
50 | 54 |
|
51 | | - # Enable these tests once there's a runner with a GPU. |
52 | | - #test_gpu: |
53 | | - # runs-on: ubuntu-24.04 |
54 | | - # name: Test |
55 | | - # steps: |
56 | | - # - uses: actions/checkout@v4 |
57 | | - # - name: Install required packages |
58 | | - # run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev |
59 | | - # - name: Run tests |
60 | | - # run: cargo test |
61 | | - # - name: Run `add` example |
62 | | - # run: cargo run --example add |
| 55 | + test_gpu: |
| 56 | + runs-on: ['self-hosted', 'linux', 'x64', '2xlarge+gpu'] |
| 57 | + name: Test |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + # TODO: Move the driver installation to the AMI. |
| 61 | + # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-nvidia-driver.html |
| 62 | + # https://www.nvidia.com/en-us/drivers/ |
| 63 | + - name: Install CUDA drivers |
| 64 | + run: | |
| 65 | + curl -L -o nvidia-driver-local-repo-ubuntu2404-570.148.08_1.0-1_amd64.deb https://us.download.nvidia.com/tesla/570.148.08/nvidia-driver-local-repo-ubuntu2404-570.148.08_1.0-1_amd64.deb |
| 66 | + sudo dpkg -i nvidia-driver-local-repo-ubuntu2404-570.148.08_1.0-1_amd64.deb |
| 67 | + sudo cp /var/nvidia-driver-local-repo-ubuntu2404-570.148.08/nvidia-driver-local-*-keyring.gpg /usr/share/keyrings/ |
| 68 | + sudo apt-get update |
| 69 | + sudo apt-get install --no-install-recommends --yes cuda-drivers |
| 70 | + rm nvidia-driver-local-repo-ubuntu2404-570.148.08_1.0-1_amd64.deb |
| 71 | + - name: Install required packages |
| 72 | + run: | |
| 73 | + sudo apt-get update |
| 74 | + sudo apt-get install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev |
| 75 | + # TODO: Remove this and other rust installation directives from jobs running |
| 76 | + - uses: dtolnay/rust-toolchain@21dc36fb71dd22e3317045c0c31a3f4249868b17 |
| 77 | + with: |
| 78 | + toolchain: 1.81 |
| 79 | + - name: Run tests |
| 80 | + run: cargo test |
| 81 | + - name: Run `add` example |
| 82 | + run: cargo run --example add |
0 commit comments