Skip to content

Commit

Permalink
fix: assorted tweaks so the crate builds again (#15)
Browse files Browse the repository at this point in the history
* fix: make crate build again

* Add checks badge

* Use appropriate commit for push/pr

* Update to latest Alire

* Force config file generation

* Name the workflow

* Disable final codecov step on macos

* Force publishing and skip actual PR creation
  • Loading branch information
mosteo authored Oct 26, 2024
1 parent b1446f2 commit edfb353
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Main

on: # Run the workflow for each of the following events:
push: # - A branch is pushed or updated.
pull_request: # - A pull-request is opened or updated.
Expand All @@ -8,22 +10,22 @@ on: # Run the workflow for each of the following events:
jobs:
main:
strategy:

fail-fast: false # Don't stop all the workflows when one of them fails.

matrix:
os: [ubuntu-latest, windows-latest, macos-latest] # List of GitHub Actions platform to run the workflow on
os: [ubuntu-latest, windows-latest, macos-13] # List of GitHub Actions platform to run the workflow on

runs-on: ${{ matrix.os }} # Run the continuous integration workflow on each OS listed in the matrix.

steps:
# Check-out the repository
- uses: actions/checkout@v2

# Install and setup Alire package manager
- uses: alire-project/setup-alire@v1
- uses: alire-project/setup-alire@v4
with:
version: 1.2.0-rc1
version: 2.0.2

# Build the project using the validation build profile to enforce static analysis and coding style.
- run: alr build --validation
Expand All @@ -32,11 +34,11 @@ jobs:
- run: alr gnatprove -j0 --level=4

# Instrument the project code for coverage analysis.
- run: cd tests && alr gnatcov instrument --level=stmt --dump-trigger=atexit --projects ada_spark_workflow.gpr
- run: cd tests && alr build && alr gnatcov instrument --level=stmt --dump-trigger=atexit --projects ada_spark_workflow.gpr

# Build testsuite with instrumented code.
- run: cd tests && alr build -- --src-subdirs=gnatcov-instr --implicit-with=gnatcov_rts_full

# Run the instrumented testsuite. This will produce at least one `.srctrace` file for the coverage analysis.
- run: cd tests && alr exec ./bin/tests

Expand All @@ -45,22 +47,29 @@ jobs:

# Upload the code coverage analysis results to codecov.io
- uses: alire-project/gnatcov-to-codecovio-action@main
if: matrix.os != 'macos-13'
# TODO: diagnose why it fails on macOS
with:
fail_ci_if_error: false # Don't fail the workflow if codecov.io failed
verbose: true

# Produce an Alire release manifest
- name: Make Release Manifest
- name: Configure Github credentials and generate manifest
shell: bash
run: |
# Set user GitHub login required for `alr publish`
alr config --set --global user.github_login ${{github.repository_owner}}
# Run Alire publish assistant
alr publish ${{github.server_url}}/${{github.repository}} ${{github.sha}}
alr settings --set --global user.github_login ${{github.repository_owner}}
# Run Alire publish assistant with the appropriate commit
# Force to allow generation for -dev version
alr -f publish --skip-submit \
${{github.server_url}}/${{github.repository}} \
${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
# Save the path to the release manifest for the next step.
# This is a little trick to get around the fact that the actions/upload-release-asset doesn't allow globing pattern.
- name: Get Release Manifest PATH
shell: bash
run: |
export MANIFEST_PATHNAME=$(ls alire/releases/*.toml | head -n 1)
echo MANIFEST_PATHNAME=$MANIFEST_PATHNAME >> $GITHUB_ENV
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Ada SPARK Workflow
A demo of best practices for open-source Ada/SPARK development.

[![checks](https://github.com/alire-project/ada_spark_workflow/workflows/main/badge.svg)](https://github.com/alire-project/ada_spark_workflow/actions)
[![codecov](https://codecov.io/gh/alire-project/ada_spark_workflow/branch/main/graph/badge.svg?token=9PZQ67LBPF)](https://codecov.io/gh/alire-project/ada_spark_workflow)

The goal of this repository is to show the best practices for Ada/SPARK open-source development. We will do our best to keep it updated with the latest technologies and services from Alire and GitHub. Don’t hesitate to suggest enhancements in case we missed something interesting.
Expand Down Expand Up @@ -293,7 +294,7 @@ The procedure is:
contribute it to the Alire index.
- Update the version number in `alire.toml` on the development branch

Push bug fixes to the MINOR release branch and only update the PATCH number
Push bug fixes to the MINOR release branch and only update the PATCH number

### `PATCH` Releases

Expand Down
4 changes: 4 additions & 0 deletions alire.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ website = "alire.ada.dev"
licenses = "MIT"

[[depends-on]]
gnat = "^12"
# Normally you don't want to depend on specific compiler versions, so you could
# remove this dependency in your project.

resources = "~0.1.0"
gnatprove = "^11.2.3"

Expand Down

0 comments on commit edfb353

Please sign in to comment.