From cae3aec338b2e582f2ec6b53d820e841660b01f6 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 10 Sep 2022 14:53:20 +0200 Subject: [PATCH] workflows: Remove special-casing of Anope --- .github/workflows/test-devel.yml | 14 ++++--- .github/workflows/test-devel_release.yml | 14 ++++--- .github/workflows/test-stable.yml | 14 ++++--- make_workflows.py | 48 +----------------------- workflows.yml | 22 +++++++++++ 5 files changed, 50 insertions(+), 62 deletions(-) diff --git a/.github/workflows/test-devel.yml b/.github/workflows/test-devel.yml index 175167e..2fad08f 100644 --- a/.github/workflows/test-devel.yml +++ b/.github/workflows/test-devel.yml @@ -5,18 +5,22 @@ jobs: build-anope: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - name: Create directories run: cd ~/; mkdir -p .local/ go/ - - name: Cache Anope + - name: Cache dependencies uses: actions/cache@v2 with: - key: 3-${{ runner.os }}-anope-2.0.9 + key: 3-${{ runner.os }}-anope-devel path: '~/.cache - ${{ github.workspace }}/anope + ${ github.workspace }/anope ' + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 - name: Checkout Anope uses: actions/checkout@v2 with: @@ -24,7 +28,7 @@ jobs: ref: 2.0.9 repository: anope/anope - name: Build Anope - run: |- + run: | cd $GITHUB_WORKSPACE/anope/ cp $GITHUB_WORKSPACE/data/anope/* . CFLAGS=-O0 ./Config -quick diff --git a/.github/workflows/test-devel_release.yml b/.github/workflows/test-devel_release.yml index 84170e4..eb1691f 100644 --- a/.github/workflows/test-devel_release.yml +++ b/.github/workflows/test-devel_release.yml @@ -5,18 +5,22 @@ jobs: build-anope: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - name: Create directories run: cd ~/; mkdir -p .local/ go/ - - name: Cache Anope + - name: Cache dependencies uses: actions/cache@v2 with: - key: 3-${{ runner.os }}-anope-2.0.9 + key: 3-${{ runner.os }}-anope-devel_release path: '~/.cache - ${{ github.workspace }}/anope + ${ github.workspace }/anope ' + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 - name: Checkout Anope uses: actions/checkout@v2 with: @@ -24,7 +28,7 @@ jobs: ref: 2.0.9 repository: anope/anope - name: Build Anope - run: |- + run: | cd $GITHUB_WORKSPACE/anope/ cp $GITHUB_WORKSPACE/data/anope/* . CFLAGS=-O0 ./Config -quick diff --git a/.github/workflows/test-stable.yml b/.github/workflows/test-stable.yml index b9a279b..4f33501 100644 --- a/.github/workflows/test-stable.yml +++ b/.github/workflows/test-stable.yml @@ -5,18 +5,22 @@ jobs: build-anope: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - name: Create directories run: cd ~/; mkdir -p .local/ go/ - - name: Cache Anope + - name: Cache dependencies uses: actions/cache@v2 with: - key: 3-${{ runner.os }}-anope-2.0.9 + key: 3-${{ runner.os }}-anope-stable path: '~/.cache - ${{ github.workspace }}/anope + ${ github.workspace }/anope ' + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 - name: Checkout Anope uses: actions/checkout@v2 with: @@ -24,7 +28,7 @@ jobs: ref: 2.0.9 repository: anope/anope - name: Build Anope - run: |- + run: | cd $GITHUB_WORKSPACE/anope/ cp $GITHUB_WORKSPACE/data/anope/* . CFLAGS=-O0 ./Config -quick diff --git a/make_workflows.py b/make_workflows.py index 32e8584..3644eeb 100644 --- a/make_workflows.py +++ b/make_workflows.py @@ -144,11 +144,7 @@ def get_test_job(*, config, test_config, test_id, version_flavor, jobs): downloads = [] install_steps = [] for software_id in test_config.get("software", []): - if software_id == "anope": - # TODO: don't hardcode anope here - software_config = {"separate_build_job": True} - else: - software_config = config["software"][software_id] + software_config = config["software"][software_id] env += test_config.get("env", {}).get(version_flavor.value, "") + " " if "prefix" in software_config: @@ -245,47 +241,6 @@ def get_test_job(*, config, test_config, test_id, version_flavor, jobs): } -def get_build_job_anope(): - return { - "runs-on": "ubuntu-latest", - "steps": [ - {"uses": "actions/checkout@v2"}, - { - "name": "Create directories", - "run": "cd ~/; mkdir -p .local/ go/", - }, - { - "name": "Cache Anope", - "uses": "actions/cache@v2", - "with": { - "path": "~/.cache\n${{ github.workspace }}/anope\n", - "key": "3-${{ runner.os }}-anope-2.0.9", - }, - }, - { - "name": "Checkout Anope", - "uses": "actions/checkout@v2", - "with": { - "repository": "anope/anope", - "ref": "2.0.9", - "path": "anope", - }, - }, - { - "name": "Build Anope", - "run": script( - "cd $GITHUB_WORKSPACE/anope/", - "cp $GITHUB_WORKSPACE/data/anope/* .", - "CFLAGS=-O0 ./Config -quick", - "make -C build -j 4", - "make -C build install", - ), - }, - *upload_steps("anope"), - ], - } - - def upload_steps(software_id): """Make a tarball (to preserve permissions) and upload""" return [ @@ -326,7 +281,6 @@ def generate_workflow(config: dict, version_flavor: VersionFlavor): } jobs = {} - jobs["build-anope"] = get_build_job_anope() for software_id in config["software"]: software_config = config["software"][software_id] diff --git a/workflows.yml b/workflows.yml index 27f43e7..80ccc1d 100644 --- a/workflows.yml +++ b/workflows.yml @@ -301,6 +301,28 @@ software: separate_build_job: true build_script: *unrealircd_build_script + + ############################# + # Services: + anope: + name: Anope + repository: anope/anope + separate_build_job: true + path: anope + refs: + stable: "2.0.9" + release: "2.0.9" + devel: "2.0.9" + devel_release: "2.0.9" + build_script: | + cd $GITHUB_WORKSPACE/anope/ + cp $GITHUB_WORKSPACE/data/anope/* . + CFLAGS=-O0 ./Config -quick + make -C build -j 4 + make -C build install + + + ############################# # Clients: