|
10 | 10 | - planewave |
11 | 11 | jobs: |
12 | 12 |
|
13 | | - start-runner: |
14 | | - name: Start self-hosted EC2 runner |
15 | | - runs-on: ubuntu-latest |
16 | | - outputs: |
17 | | - label: ${{ steps.start-ec2-runner.outputs.label }} |
18 | | - ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }} |
19 | | - steps: |
20 | | - - name: Configure AWS credentials |
21 | | - uses: aws-actions/configure-aws-credentials@v1 |
22 | | - with: |
23 | | - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
24 | | - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
25 | | - aws-region: ${{ secrets.AWS_REGION }} |
26 | | - - name: Start EC2 runner |
27 | | - id: start-ec2-runner |
28 | | - uses: machulav/ec2-github-runner@v2 |
29 | | - with: |
30 | | - mode: start |
31 | | - github-token: ${{ secrets.PAT }} |
32 | | - ec2-image-id: ami-07758124f42f794bf |
33 | | - ec2-instance-type: c5.2xlarge |
34 | | - subnet-id: subnet-f7edb991 |
35 | | - security-group-id: sg-fd5185e7 |
36 | 13 | test: |
37 | 14 | name: Do the job on the runner |
38 | | - needs: start-runner # required to start the main job when the runner is ready |
39 | | - runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner |
| 15 | + runs-on: self-hosted |
40 | 16 | container: ghcr.io/deepmodeling/abacus-development-kit:gnu |
41 | 17 | steps: |
42 | 18 | - name: Checkout |
|
49 | 25 | run: | |
50 | 26 | cmake -B build -DBUILD_TESTING=ON |
51 | 27 | cmake --build build -j16 |
52 | | - cmake --install build |
53 | | - cmake --build build --target test ARGS="-V" |
54 | | - stop-runner: |
55 | | - name: Stop self-hosted EC2 runner |
56 | | - needs: |
57 | | - - start-runner # required to get output from the start-runner job |
58 | | - - test # required to wait when the main job is done |
59 | | - runs-on: ubuntu-latest |
60 | | - if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs |
61 | | - steps: |
62 | | - - name: Configure AWS credentials |
63 | | - uses: aws-actions/configure-aws-credentials@v1 |
64 | | - with: |
65 | | - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
66 | | - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
67 | | - aws-region: ${{ secrets.AWS_REGION }} |
68 | | - - name: Stop EC2 runner |
69 | | - uses: machulav/ec2-github-runner@v2 |
70 | | - with: |
71 | | - mode: stop |
72 | | - github-token: ${{ secrets.PAT }} |
73 | | - label: ${{ needs.start-runner.outputs.label }} |
74 | | - ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }} |
0 commit comments