|
15 | 15 | - swiftwasm-release/5.4
|
16 | 16 | - swiftwasm-release/5.5
|
17 | 17 | - swiftwasm-release/5.6
|
| 18 | + types: [opened, synchronize, reopened, labeled] |
18 | 19 | jobs:
|
19 |
| - build_toolchain: |
| 20 | + start-runner: |
| 21 | + name: Start self-hosted EC2 runner |
| 22 | + runs-on: ubuntu-latest |
| 23 | + # Run only on main branches to avoid triggers by non-collaborator |
| 24 | + if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'check-self-hosted-ci') }} |
| 25 | + outputs: |
| 26 | + ubuntu20_04_aarch64-label: ${{ steps.start-ubuntu20_04_aarch64-runner.outputs.label }} |
| 27 | + amazonlinux2_x86_64-label: ${{ steps.start-amazonlinux2_x86_64-runner.outputs.label }} |
| 28 | + ubuntu20_04_aarch64-ec2-instance-id: ${{ steps.start-ubuntu20_04_aarch64-runner.outputs.ec2-instance-id }} |
| 29 | + amazonlinux2_x86_64-ec2-instance-id: ${{ steps.start-amazonlinux2_x86_64-runner.outputs.ec2-instance-id }} |
| 30 | + steps: |
| 31 | + - name: Configure AWS credentials |
| 32 | + uses: aws-actions/configure-aws-credentials@v1 |
| 33 | + with: |
| 34 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 35 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 36 | + aws-region: ${{ secrets.AWS_REGION }} |
| 37 | + - name: Start EC2 runner (ubuntu20_04_aarch64) |
| 38 | + id: start-ubuntu20_04_aarch64-runner |
| 39 | + uses: machulav/ec2-github-runner@v2 |
| 40 | + with: |
| 41 | + mode: start |
| 42 | + github-token: ${{ secrets.SWIFTWASM_BUILDBOT_TOKEN }} |
| 43 | + ec2-image-id: ami-0d08b938af6d9dbb0 # swiftwasm-ci/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-20211129 |
| 44 | + ec2-instance-type: c6g.large |
| 45 | + subnet-id: subnet-327f4a13 |
| 46 | + security-group-id: sg-0429f5ec2bee9dc0c |
| 47 | + - name: Start EC2 runner (amazonlinux2_x86_64) |
| 48 | + id: start-amazonlinux2_x86_64-runner |
| 49 | + uses: machulav/ec2-github-runner@v2 |
| 50 | + with: |
| 51 | + mode: start |
| 52 | + github-token: ${{ secrets.SWIFTWASM_BUILDBOT_TOKEN }} |
| 53 | + ec2-image-id: ami-059fc55111c686d49 # swiftwasm-ci/amzn2-ami-kernel-5.10-hvm-2.0.20211223.0-x86_64-gp2 |
| 54 | + ec2-instance-type: c6i.large |
| 55 | + subnet-id: subnet-327f4a13 |
| 56 | + security-group-id: sg-0429f5ec2bee9dc0c |
| 57 | + stop-runner: |
| 58 | + name: Stop self-hosted EC2 runner |
| 59 | + needs: [start-runner, build-toolchain] |
| 60 | + runs-on: ubuntu-latest |
| 61 | + # Required to stop the runner even if the error happened in the previous jobs |
| 62 | + if: ${{ always() && needs.start-runner.result == 'success' }} |
| 63 | + steps: |
| 64 | + - name: Configure AWS credentials |
| 65 | + uses: aws-actions/configure-aws-credentials@v1 |
| 66 | + with: |
| 67 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 68 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 69 | + aws-region: ${{ secrets.AWS_REGION }} |
| 70 | + - name: Stop EC2 runner (ubuntu20_04_aarch64) |
| 71 | + uses: machulav/ec2-github-runner@v2 |
| 72 | + with: |
| 73 | + mode: stop |
| 74 | + github-token: ${{ secrets.SWIFTWASM_BUILDBOT_TOKEN }} |
| 75 | + label: ${{ needs.start-runner.outputs.ubuntu20_04_aarch64-label }} |
| 76 | + ec2-instance-id: ${{ needs.start-runner.outputs.ubuntu20_04_aarch64-ec2-instance-id }} |
| 77 | + - name: Stop EC2 runner (amazonlinux2_x86_64) |
| 78 | + uses: machulav/ec2-github-runner@v2 |
| 79 | + with: |
| 80 | + mode: stop |
| 81 | + github-token: ${{ secrets.SWIFTWASM_BUILDBOT_TOKEN }} |
| 82 | + label: ${{ needs.start-runner.outputs.amazonlinux2_x86_64-label }} |
| 83 | + ec2-instance-id: ${{ needs.start-runner.outputs.amazonlinux2_x86_64-ec2-instance-id }} |
| 84 | + |
| 85 | + build-matrix: |
| 86 | + name: Build matrix |
| 87 | + needs: [start-runner] |
| 88 | + runs-on: ubuntu-latest |
| 89 | + if: ${{ always() }} |
| 90 | + outputs: |
| 91 | + entries: ${{ steps.generate.outputs.entries }} |
| 92 | + steps: |
| 93 | + - name: Generate entries |
| 94 | + id: generate |
| 95 | + run: | |
| 96 | + MATRIX_ENTRIES="[" |
| 97 | + MATRIX_ENTRIES="$MATRIX_ENTRIES"$(cat <<EOS |
| 98 | + { |
| 99 | + "build_os": "ubuntu-18.04", |
| 100 | + "agent_query": "ubuntu-18.04", |
| 101 | + "target": "ubuntu18.04_x86_64", |
| 102 | + "run_stdlib_test": true, |
| 103 | + "run_full_test": false, |
| 104 | + "run_e2e_test": true, |
| 105 | + "build_hello_wasm": true, |
| 106 | + "clean_build_dir": false, |
| 107 | + "free_disk_space": true |
| 108 | + }, |
| 109 | + { |
| 110 | + "build_os": "ubuntu-20.04", |
| 111 | + "agent_query": "ubuntu-20.04", |
| 112 | + "target": "ubuntu20.04_x86_64", |
| 113 | + "run_stdlib_test": true, |
| 114 | + "run_full_test": false, |
| 115 | + "run_e2e_test": true, |
| 116 | + "build_hello_wasm": true, |
| 117 | + "clean_build_dir": false, |
| 118 | + "free_disk_space": true |
| 119 | + }, |
| 120 | + { |
| 121 | + "build_os": "macos-11", |
| 122 | + "agent_query": "macos-11", |
| 123 | + "target": "macos_x86_64", |
| 124 | + "run_stdlib_test": true, |
| 125 | + "run_full_test": true, |
| 126 | + "run_e2e_test": true, |
| 127 | + "build_hello_wasm": true, |
| 128 | + "clean_build_dir": false |
| 129 | + }, |
| 130 | + { |
| 131 | + "build_os": "macos-11", |
| 132 | + "agent_query": ["self-hosted", "macOS", "ARM64"], |
| 133 | + "target": "macos_arm64", |
| 134 | + "run_stdlib_test": false, |
| 135 | + "run_full_test": false, |
| 136 | + "run_e2e_test": false, |
| 137 | + "build_hello_wasm": true, |
| 138 | + "clean_build_dir": true |
| 139 | + } |
| 140 | + EOS |
| 141 | + ) |
| 142 | +
|
| 143 | + if [[ ${{ needs.start-runner.result }} == "success" ]]; then |
| 144 | + MATRIX_ENTRIES="$MATRIX_ENTRIES," |
| 145 | + MATRIX_ENTRIES="$MATRIX_ENTRIES"$(cat <<EOS |
| 146 | + { |
| 147 | + "build_os": "amazon-linux-2", |
| 148 | + "agent_query": "${{ needs.start-runner.outputs.amazonlinux2_x86_64-label }}", |
| 149 | + "target": "amazonlinux2_x86_64", |
| 150 | + "run_stdlib_test": false, |
| 151 | + "run_full_test": false, |
| 152 | + "run_e2e_test": false, |
| 153 | + "build_hello_wasm": true, |
| 154 | + "clean_build_dir": false |
| 155 | + } |
| 156 | + EOS |
| 157 | + ) |
| 158 | +
|
| 159 | + MATRIX_ENTRIES="$MATRIX_ENTRIES," |
| 160 | + MATRIX_ENTRIES="$MATRIX_ENTRIES"$(cat <<EOS |
| 161 | + { |
| 162 | + "build_os": "ubuntu-20.04", |
| 163 | + "agent_query": "${{ needs.start-runner.outputs.ubuntu20_04_aarch64-label }}", |
| 164 | + "target": "ubuntu20.04_aarch64", |
| 165 | + "run_stdlib_test": false, |
| 166 | + "run_full_test": false, |
| 167 | + "run_e2e_test": false, |
| 168 | + "build_hello_wasm": true, |
| 169 | + "clean_build_dir": false |
| 170 | + } |
| 171 | + EOS |
| 172 | + ) |
| 173 | + fi |
| 174 | + MATRIX_ENTRIES="$MATRIX_ENTRIES]" |
| 175 | + MATRIX_ENTRIES="${MATRIX_ENTRIES//$'\n'/''}" |
| 176 | + echo "::set-output name=entries::$MATRIX_ENTRIES" |
| 177 | +
|
| 178 | + build-toolchain: |
20 | 179 | env:
|
21 | 180 | TOOLCHAIN_CHANNEL: 5.6
|
22 | 181 | DEVELOPER_DIR: /Applications/Xcode_13.0.app/Contents/Developer/
|
| 182 | + needs: [build-matrix] |
23 | 183 | strategy:
|
24 | 184 | matrix:
|
25 |
| - include: |
26 |
| - - build_os: amazon-linux-2 |
27 |
| - agent_query: [AmazonLinux2, X64] |
28 |
| - target: amazonlinux2_x86_64 |
29 |
| - run_stdlib_test: false |
30 |
| - run_full_test: false |
31 |
| - run_e2e_test: false |
32 |
| - build_hello_wasm: true |
33 |
| - clean_build_dir: true |
34 |
| - |
35 |
| - - build_os: ubuntu-18.04 |
36 |
| - agent_query: ubuntu-18.04 |
37 |
| - target: ubuntu18.04_x86_64 |
38 |
| - run_stdlib_test: true |
39 |
| - run_full_test: false |
40 |
| - run_e2e_test: true |
41 |
| - build_hello_wasm: true |
42 |
| - clean_build_dir: false |
43 |
| - free_disk_space: true |
44 |
| - |
45 |
| - - build_os: ubuntu-20.04 |
46 |
| - agent_query: ubuntu-20.04 |
47 |
| - target: ubuntu20.04_x86_64 |
48 |
| - run_stdlib_test: true |
49 |
| - run_full_test: false |
50 |
| - run_e2e_test: true |
51 |
| - build_hello_wasm: true |
52 |
| - clean_build_dir: false |
53 |
| - free_disk_space: true |
54 |
| - |
55 |
| - - build_os: ubuntu-20.04 |
56 |
| - agent_query: [ubuntu20.04, ARM64] |
57 |
| - target: ubuntu20.04_aarch64 |
58 |
| - run_stdlib_test: false |
59 |
| - run_full_test: false |
60 |
| - run_e2e_test: false |
61 |
| - build_hello_wasm: true |
62 |
| - clean_build_dir: true |
63 |
| - |
64 |
| - - build_os: macos-11 |
65 |
| - agent_query: macos-11 |
66 |
| - target: macos_x86_64 |
67 |
| - run_stdlib_test: true |
68 |
| - run_full_test: true |
69 |
| - run_e2e_test: true |
70 |
| - build_hello_wasm: true |
71 |
| - clean_build_dir: false |
72 |
| - |
73 |
| - - build_os: macos-11 |
74 |
| - agent_query: [self-hosted, macOS, ARM64] |
75 |
| - target: macos_arm64 |
76 |
| - # FIXME: Enable stdlib test after wasmer fixes singlepass bug on arm64, |
77 |
| - # fixes cranelift bug on x64, or wasmtime supports arm64 |
78 |
| - # Currently it's hard to run tests on both x64 and arm64. |
79 |
| - run_stdlib_test: false |
80 |
| - run_full_test: false |
81 |
| - run_e2e_test: false |
82 |
| - build_hello_wasm: true |
83 |
| - clean_build_dir: true |
| 185 | + include: ${{ fromJSON(needs.build-matrix.outputs.entries) }} |
84 | 186 |
|
85 | 187 | name: Target ${{ matrix.target }}
|
86 | 188 | timeout-minutes: 0
|
@@ -114,10 +216,8 @@ jobs:
|
114 | 216 |
|
115 | 217 | - name: Prepare sccache timestamp
|
116 | 218 | id: cache_timestamp
|
117 |
| - shell: cmake -P {0} |
118 | 219 | run: |
|
119 |
| - string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) |
120 |
| - message("::set-output name=timestamp::${current_date}") |
| 220 | + echo "::set-output name=timestamp::$(date +'%Y-%m-%d-%I-%M-%S')" |
121 | 221 |
|
122 | 222 | - name: Check Xcode version
|
123 | 223 | if: ${{ startsWith(matrix.build_os, 'macos-') }}
|
|
0 commit comments