Merge pull request #146 from demotomohiro/add-nim-2.2.2 #106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: C++ | |
on: | |
push: | |
env: | |
ASSETS_URL: "https://api.github.com/repos/melpon/wandbox-builder/releases/178117233/assets" | |
UPLOAD_URL: "https://uploads.github.com/repos/melpon/wandbox-builder/releases/178117233/assets{?name,label}" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
_asset: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- run: | | |
pip3 install requests | |
python3 get_asset_info.py ${{ env.ASSETS_URL }} --github_token ${{ env.GITHUB_TOKEN }} > asset_info.json | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: asset_info.json | |
path: asset_info.json | |
gcc: | |
needs: [_asset] | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- 13.2.0 | |
- 12.3.0 | |
- 11.4.0 | |
- 10.5.0 | |
- 9.3.0 | |
- 8.4.0 | |
- 7.5.0 | |
- 6.5.0 | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-compiler | |
with: | |
name: ${{ github.job }} | |
version: ${{ matrix.version }} | |
upload_url: ${{ env.UPLOAD_URL }} | |
clang: | |
needs: [_asset] | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- 17.0.1 | |
- 16.0.4 | |
- 15.0.7 | |
- 14.0.6 | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-compiler | |
with: | |
name: ${{ github.job }} | |
version: ${{ matrix.version }} | |
upload_url: ${{ env.UPLOAD_URL }} | |
boost: | |
needs: [_asset, gcc, clang] | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- 1.83.0 gcc 13.2.0 | |
- 1.81.0 gcc 12.3.0 | |
- 1.79.0 gcc 11.4.0 | |
- 1.78.0 gcc 11.4.0 | |
- 1.75.0 gcc 11.4.0 | |
- 1.75.0 gcc 10.5.0 | |
- 1.75.0 gcc 9.3.0 | |
- 1.75.0 gcc 8.4.0 | |
- 1.75.0 gcc 7.5.0 | |
- 1.75.0 gcc 6.5.0 | |
- 1.83.0 clang 17.0.1 | |
- 1.81.0 clang 16.0.4 | |
- 1.80.0 clang 15.0.7 | |
- 1.79.0 clang 14.0.6 | |
- 1.78.0 clang 14.0.6 | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-compiler | |
with: | |
name: ${{ github.job }} | |
version: ${{ matrix.version }} | |
upload_url: ${{ env.UPLOAD_URL }} | |
_deploy: | |
needs: | |
- gcc | |
- clang | |
- boost | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
# SSH 秘密鍵の登録 | |
- name: Register SSH key | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
run: | | |
mkdir -p $HOME/.ssh | |
echo "$SSH_PRIVATE_KEY" > $HOME/.ssh/id_ed25519 | |
chmod 600 $HOME/.ssh/id_ed25519 | |
# デプロイ先を設定する | |
- name: Add SSH config | |
env: | |
SSH_HOST: ${{ secrets.SSH_HOST_UBUNTU_24_04 }} | |
SSH_USER: ${{ secrets.SSH_USER }} | |
run: | | |
echo "Host wandbox-ubuntu-24.04" >> $HOME/.ssh/config | |
echo " HostName $SSH_HOST" >> $HOME/.ssh/config | |
echo " User $SSH_USER" >> $HOME/.ssh/config | |
echo " ServerAliveInterval 60" >> $HOME/.ssh/config | |
echo " TCPKeepAlive yes" >> $HOME/.ssh/config | |
ssh-keyscan -H $SSH_HOST >> $HOME/.ssh/known_hosts | |
# ソースをデプロイ先にコピーして、デプロイスクリプトを実行する | |
- id: deploy | |
name: Deploy | |
run: | | |
set -ex | |
COMMIT=`git log --format=%as.%h -n 1 HEAD` | |
ssh wandbox-ubuntu-24.04 'mkdir -p /opt/wandbox-data' | |
rsync -a -v . wandbox-ubuntu-24.04:/opt/wandbox-data/wandbox-builder | |
ssh wandbox-ubuntu-24.04 "python3 /opt/wandbox-data/wandbox-builder/deploy.py $GITHUB_WORKFLOW $COMMIT ${{ env.ASSETS_URL }} --github_token ${{ env.GITHUB_TOKEN }}" | |
- name: Generate Configuration | |
if: steps.deploy.outputs.deployed == 'true' | |
run: | | |
ssh wandbox-ubuntu-24.04 'mkdir -p /opt/wandbox-data/release/cattleshed-conf' | |
ssh wandbox-ubuntu-24.04 'python3 /opt/wandbox-data/wandbox-builder/cattleshed-conf/compilers.py > /opt/wandbox-data/release/cattleshed-conf/compilers.default' | |
- name: Restart Cattleshed | |
if: steps.deploy.outputs.deployed == 'true' | |
run: | | |
ssh wandbox-ubuntu-24.04 'systemctl restart cattleshed-master' | |
ssh wandbox-ubuntu-24.04 'systemctl restart cattleshed-develop' | |
sleep 30 | |
- name: Restart Kennel | |
if: steps.deploy.outputs.deployed == 'true' | |
run: | | |
ssh wandbox-ubuntu-24.04 'systemctl restart kennel-master' | |
ssh wandbox-ubuntu-24.04 'systemctl restart kennel-develop' |