Index #93
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: Index | |
on: | |
workflow_dispatch: | |
schedule: | |
# At 00:00 every Saturday. | |
- cron: "0 0 * * 6" | |
# Cancel any in-progress run | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
EC2_RUNNER_ID: i-0829aea272db4290b | |
AWS_REGION: us-east-1 | |
jobs: | |
start-ec2-runner: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-region: ${{ env.AWS_REGION }} | |
aws-access-key-id: ${{ secrets.EC2_GITHUB_RUNNER_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.EC2_GITHUB_RUNNER_AWS_SECRET_ACCESS_KEY }} | |
- name: Start EC2 runner | |
id: start_ec2_runner | |
run: | | |
aws ec2 start-instances --instance-ids ${{ env.EC2_RUNNER_ID }} | |
aws ec2 wait instance-running --instance-ids ${{ env.EC2_RUNNER_ID }} | |
index-lua: | |
runs-on: multiplier | |
needs: start-ec2-runner | |
container: | |
image: ghcr.io/trailofbits/multiplier:builder | |
credentials: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.github_token }} | |
steps: | |
- name: Download and build Lua | |
run: | | |
curl --silent --location \ | |
https://www.lua.org/ftp/lua-5.4.4.tar.gz | tar xz -C '/work/src' | |
cd '/work/src/lua-5.4.4' | |
bear -- make | |
- name: Index Lua | |
run: | | |
mx-index \ | |
--db /tmp/lua-5.4.4.mx \ | |
--target '/work/src/lua-5.4.4/compile_commands.json' | |
- name: List functions | |
run: | | |
mx-list-functions \ | |
--db /tmp/lua-5.4.4.mx | |
- name: Upload Lua index | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lua-5.4.4 | |
path: /tmp/lua-5.4.4.mx | |
index-pcre2: | |
runs-on: multiplier | |
needs: start-ec2-runner | |
container: | |
image: ghcr.io/trailofbits/multiplier:builder | |
credentials: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.github_token }} | |
steps: | |
- name: Download, configure and build PCRE2 | |
run: | | |
curl --silent --location \ | |
https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2 | tar xj -C '/work/src' | |
mkdir '/work/build/pcre2-10.42' | |
cd '/work/build/pcre2-10.42' | |
/work/src/pcre2-10.42/configure | |
bear -- make | |
- name: Index PCRE2 | |
run: | | |
mx-index \ | |
--db /tmp/pcre2-10.42.mx \ | |
--target '/work/build/pcre2-10.42/compile_commands.json' | |
- name: List functions | |
run: | | |
mx-list-functions \ | |
--db /tmp/pcre2-10.42.mx | |
- name: Upload PCRE2 index | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pcre2-10.42 | |
path: /tmp/pcre2-10.42.mx | |
stop-ec2-runner: | |
if: always() | |
runs-on: ubuntu-latest | |
needs: | |
- index-lua | |
- index-pcre2 | |
steps: | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
aws-access-key-id: ${{ secrets.EC2_GITHUB_RUNNER_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.EC2_GITHUB_RUNNER_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Stop EC2 runner | |
run: aws ec2 stop-instances --instance-ids ${{ env.EC2_RUNNER_ID }} |